Android中自定义特定颜色的Toast
来源:互联网 发布:催眠的电影 知乎 编辑:程序博客网 时间:2024/05/21 22:47
/** * 展示一个特定颜色的Toast * * @param message */ protected void toast(String message) { View toastRoot = LayoutInflater.from(context).inflate(R.layout.toast, null); Toast toast = new Toast(context); toast.setView(toastRoot); TextView tv = (TextView) toastRoot.findViewById(R.id.toast_notice); tv.setText(message); toast.show(); }Toast的布局文件如下
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/toast_border"> <TextView android:id="@+id/toast_notice" android:layout_width="wrap_content" android:layout_height="@dimen/toast_height" android:layout_gravity="center_vertical" android:gravity="center_vertical" android:textColor="@color/app_toast_text"> </TextView></LinearLayout>
0 0
- Android中自定义特定颜色的Toast
- Android自定义边框背景颜色的Toast
- Android中自定义Toast
- android中自定义toast
- android中自定义toast
- Android中自定义Toast
- Android中自定义Toast
- Android中Toast的自定义的样式
- Android中Toast显示时间的自定义
- Android中Toast显示时间的自定义
- Android中Toast显示时间的自定义
- Android中Toast显示时间的自定义
- Android:自定义的Toast
- Android开发中自定义Toast
- Android自定义Toast取代系统的Toast
- android自定义风格的toast
- android自定义的toast样式
- Android自定义Toast的使用
- C/C++ 数组下标可以是负值
- (1059)HDU
- LeetCode141:Given a linked list, determine if it has a cycle in it.
- Merge Sorted Array
- 24天学会设计模式------策略模式
- Android中自定义特定颜色的Toast
- php处理数组时,常用的两个函数
- 最小生成树 Prim以及Kruskal算法及效率解析
- c#一次上传多个文件的写法
- 使用C#获取CPU及硬盘序列号的源代码
- 人脸识别系统原理
- CUDA系列学习(四)Parallel Task类型 与 Memory Allocation
- 书籍下架情况分析
- uva 699 The Falling Leaves (二叉树)