首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

设立Toast显示的位置

2012-09-23 
设置Toast显示的位置可以使用如下方法设置 Toast 显示的位置?public void?setGravity?(int gravity, int x

设置Toast显示的位置

可以使用如下方法设置 Toast 显示的位置

?

public void?setGravity?(int gravity, int xOffset, int yOffset)Since:?API Level 1

Set the location at which the notification should appear on the screen.

?

默认的 Gravity 是

 int mGravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
显示在屏幕的下方,水平居中。

热点排行