10

可能重复:
如何在 android 中更改 Toast 的位置?

Toast当用户按下 a 时,我必须显示a Button,但我想在screen.

我怎样才能做到这一点?

这是我的代码Toast

Toast.makeText(getApplicationContext(),
getString(R.string.emailregisternotentered),
Toast.LENGTH_SHORT).show();

解决了:

Toast toast= Toast.makeText(getApplicationContext(), 
getString(R.string.emailregisternotentered), Toast.LENGTH_SHORT);  
//Toast.makeText(getApplicationContext(), getString(R.string.emailregisternotentered),
//Toast.LENGTH_SHORT).show();
toast.setGravity(Gravity.BOTTOM, 0, 0);
toast.show();
4

2 回答 2

6

这是文档:

http://developer.android.com/guide/topics/ui/notifiers/toasts.html#Positioning

于 2010-12-18T12:42:57.193 回答
2

Toast.setGravity是一种选择。

于 2010-12-18T12:43:32.503 回答