自定义Toast
来源:互联网 发布:盐城大数据产业园招聘 编辑:程序博客网 时间:2024/04/29 05:49
public class CustomToast extends Toast {
private TextView textView;
private String text;
private View view;
private int time;
private Context context;
public CustomToast(Context context,String text,int time) {
super(context);
this.context = context;
this.text = text;
this.time = time;
init();
}
private void init() {
view = View.inflate(context, R.layout.custom_toast, null);
setView(view);
textView = (TextView) view.findViewById(R.id.textView);
textView.setText(text);
setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);
setDuration(time);
}
}
private TextView textView;
private String text;
private View view;
private int time;
private Context context;
public CustomToast(Context context,String text,int time) {
super(context);
this.context = context;
this.text = text;
this.time = time;
init();
}
private void init() {
view = View.inflate(context, R.layout.custom_toast, null);
setView(view);
textView = (TextView) view.findViewById(R.id.textView);
textView.setText(text);
setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);
setDuration(time);
}
}
0 0
- 自定义Toast
- 自定义Toast
- 自定义Toast
- 自定义Toast
- 自定义toast
- 自定义toast
- 自定义Toast
- 自定义toast
- 自定义Toast
- 自定义Toast
- 自定义Toast
- Toast自定义
- 自定义Toast
- 自定义Toast
- 自定义Toast
- 自定义Toast
- 自定义toast
- 自定义Toast
- 将DataTable转换成json字符串
- 4月21
- ViewPager 禁止滑动
- 数据存储之SharedPreferences(系统偏好设置)(一)
- 乘法
- 自定义Toast
- ionic ion-slide-box网络加载图片,及时更新,无限循环
- 三位数乘一位数
- 常见的各种距离总结
- git 常用命令
- ImageSwitcher图片切换器的简单功能用法
- 当需要对一个list<Map<String,Object>>中的map添加一个相同的数据是可以参考
- [poj1741]tree 解题报告
- ubuntu 配置网络