自定义好看的吐司
来源:互联网 发布:php 设置时间 编辑:程序博客网 时间:2024/04/27 17:01
如何定义好看的Toast:
一.工具类
package utils;
import com.example.minimalist_telephone.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class ToastUtils {
public static Toast mToast;
public static void SetToast(Context context, String text) { if (mToast == null) { mToast = new Toast(context); } LayoutInflater inflate = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflate.inflate(R.layout.toast_view, null); TextView tv_text = (TextView) view.findViewById(R.id.tv_text); if (text.equals(null)) { tv_text.setText(""); } else { tv_text.setText(text); } mToast.setView(view); mToast.setDuration(Toast.LENGTH_SHORT); mToast.show();}
}
二.引入的xml文件
0 0
- 自定义好看的吐司
- android自定义吐司的使用
- 自定义吐司
- 自定义吐司
- 自定义吐司:
- 自定义吐司
- 自定义吐司
- 自定义吐司
- 自定义吐司
- 自定义吐司
- 好看的 自定义AlertDialog
- 抽屉吐司——自定义的Toast
- android自定义吐司toast的方法
- 自定义控件-自定义吐司
- 自定义实现好看的toast
- android 好看的自定义日历
- Android自定义吐司(Toast)
- Android自定义吐司(Toast)
- 当pycharm不支持svn时,怎么处理(for windows)
- eclipse导入的jar包中包路径和类名与本地工程包路径类名冲突的解决办法
- python中如何用正则表达式匹配汉字
- zend studio vim插件安装
- driver.navigate().to()和driver.get()区别
- 自定义好看的吐司
- python解析xml的方法总结
- python numpy教程
- Scipy:高端科学计算
- zend studio 中使用yii方法
- KAFKA分布式消息系统
- codeforces round#404(div.2) D. Anton and School
- Python中的属性管理
- Django执行原始SQL