获得并设置textview的颜色,替代已过时的getcolor用法
来源:互联网 发布:华道数据徐州分公司 编辑:程序博客网 时间:2024/05/16 05:43
获取textview当前颜色
textview.getCurrentTextColor();
获取colors.xml中的颜色
int textColor = getResources().getColor(R.color.mycolor);
getcolor已过时!
应该使用如下方法替代:
ContextCompat.getColor(context, R.color.my_color);
其中context可以是MyActivity.this
R.color.my_color就是color.xml中颜色的ID
0 0
- 获得并设置textview的颜色,getcolor已过时的替代用法
- 获得并设置textview的颜色,替代已过时的getcolor用法
- 过时的getResources().getColor()的替代方法
- getDrawable,getColor 过时的替代方法
- getDrawable,getColor 过时的替代方法
- getResources().getColor()方法过时的替代方法
- 添加颜色getResources.getColor()过时的替换
- Android的getColor,getDrawable过时的替代方法
- Android-6.0-23的getColor()过时替代方法
- [问题解决]Android中getDrawable和getColor过时的替代方法
- getColor过时方法替代
- android-6.0-23的getColor过时
- android-6.0-23的getColor过时
- Android 6.0 的getColor()方法过时
- getDrawable()和getColor()过时的解决办法
- 过时的getResources().getColor,和getResources().getDrawable
- getColor过时,setTextColor的现用方法
- getColor()方法过时的解决办法
- 史上最全的Javascript面试题总结(内附答案)
- Android 基础工具类 摘自quantan.liu 易读项目
- html rel="external nofollow"
- myEclipse 非正常关闭
- 修改包名,安装多个版本
- 获得并设置textview的颜色,替代已过时的getcolor用法
- 次第花开读书笔记
- ssh实现文件上传
- 正则表达式匹配IP详解
- base64解密
- 膨胀与腐蚀算法
- ZigBee 3.0 《Base-Device-Behavior-Specification》--Network steering(在网)
- WPF:ListBox的默认ItemContainerStyle
- Agent和Broker的差别是什么?