TextView动态设置字体颜色selector不起作用?
来源:互联网 发布:南京纬创软件 编辑:程序博客网 时间:2024/05/22 13:03
在代码中动态设置了TextView的颜色选择器
holder.bt_buy.setTextColor(mcontext.getResources().getColor(R.color.selector_text_orange_white));
然而这个并没有什么效果,
应该这么写:
holder.bt_buy.setTextColor(mcontext.getResources().getColorStateList(R.color.selector_text_orange_white));当然在布局中还是可以直接使用:
android:textColor="@color/selector_text_theme_white"
阅读全文
0 0
- TextView动态设置字体颜色selector不起作用?
- TextView 使用Selector设置颜色
- Android通过selector选择器设置Button或者textview的背景颜色,字体颜色
- 通过选择器selector给TextView,Button设置字体颜色和背景颜色
- selector修改TextView中字体的颜色
- android selector修改TextView字体颜色
- TextView动态设置字体
- android 的TextView空间动态设置字体颜色
- SpannableString 动态设置textView中字体颜色和大小
- TextView(怎么用代码动态设置字体颜色)
- TextView selector不起作用
- ANDROID TEXTVIEW 设置字体颜色
- TextView字体颜色设置方法
- ANDROID TEXTVIEW 设置字体颜色
- TextView 设置个别字体颜色
- ANDROID TEXTVIEW 设置字体颜色
- Android 设置TextView字体颜色
- ANDROID TEXTVIEW 设置字体颜色
- ES6学习笔记:箭头函数
- 红黑树详解
- Timer——让你的程序定时执行(Java)
- HTML基础知识2
- PAT(Basic Level)_1004_成绩排名
- TextView动态设置字体颜色selector不起作用?
- Mondrian Schema介绍及简单配置示例
- C++ bind参数绑定
- leetcode 452. Minimum Number of Arrows to Burst Balloons
- spacemacs操作卡顿的解决方法
- 应用JavaScript(一):表单验证
- 搭建自己的Nuget服务器
- TCP三次握手与四次挥手
- Codeforces Round #417 (Div. 2) B. Sagheer, the Hausmeister