Toast 的显示位置能不能修改?
默认是在屏幕的下方,我想移到屏幕的上方。
[解决办法]
toast.setGravity(Gravity.TOP
[解决办法]
Gravity.CENTER_HORIZONTAL,0,0);
[解决办法]
参考接口:
public void setGravity (int gravity, int xOffset, int yOffset)
Added in API level 1
Set the location at which the notification should appear on the screen.
See Also
Gravity