- 1.toast通知
- Toast toast = Toast.makeText(MainActivity.this, “提示信息”, Toast.LENTH_LONG);
- 自定义通知
- Toast toast = Toast.makeText(MainActivity.this);
- View view = Layout.Infalter.from(MainActivity).infalter(R.layout.布局文件名, null);
- 获取view的控件
- toast.setDuration(Toast.LENTH_LONG);
- toast.setGravity(Gratvity.CENTER,x,y); //设置显示位置
- toast.setView(view);
- toast.show( );//显示
复制代码
|
|