关于TextView.setTextColor(int); 括号里那个颜色int值的问题
来源:互联网 发布:socket() python 编辑:程序博客网 时间:2024/05/17 10:56
第1种:tv.setTextColor(android.graphics.Color.RED);//系统自带的颜色类
第2种:tv.setTextColor(0xffff00ff);//0xffff00ff是int类型的数据,分组一下 0x|ff|ff00ff,0x是代表颜色整数的标记,ff是表示透明度,ff00ff表示颜色,注意:这里ffff00ff必须是8个的颜色表示,不接受ff00ff这种6个的颜色表示。
第3种:tv.setTextColor(this.getResources().getColor(R.color.red));//通过获得资源文件进行设置。根据不同的情况R.color.red也可以是R.string.red或者R.drawable.red,当然前提是需要在相应的配置文件里做相应的配置,如:
错误的写法:tv.setTextColor(R.color.red);
被这个函数玩了一晚上
0 0
- 关于TextView.setTextColor(int); 括号里那个颜色int值的问题
- 关于TextView.setTextColor(int); 括号里那个颜色int值的问题
- TextView.setTextColor(int); 括号里那个颜色int值的理解
- android开发之形似“TextView.setTextColor(int)”括号里那个设置颜色的颜色int值的理解
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- Android中设置TextView的颜色setTextColor
- 关于数据类型的一个小问题 (int) (int &) (int ) &
- 自定义颜色的setTextColor问题
- 一个关于int值越界的问题
- 关于unsigned int的 问题
- TextView setTextColor 设置颜色失败
- Android设置TextView颜色setTextColor
- ZXing 二维码应用
- OCP 1Z0 053 257
- Android进程通信之AIDL
- 你应该知道的Tor的七件事
- 2015 APAC Test
- 关于TextView.setTextColor(int); 括号里那个颜色int值的问题
- 关于取消动态节点回发服务器的代码
- Android Service 服务(一)—— Service
- UVA10483 - The Sum Equals the Product(枚举)
- 2014上海书展
- 跟我复习Java基础中的精髓之一
- Automation自动化测试IOS设备
- AtomicIntegerFieldUpdater多线程原子类的使用
- Subsets leetcode