android textColor设置drawable selector失效问题
好几次遇到这个问题,现在在这里记录一下:
在使用
android:textColor=“@drawable/selector_check_box_text_color”
去设置字体颜色,使文字颜色动态进行改变时,没有设置成功,原因是因为如果我们需要对文字颜色使用selector时,需要在item中使用
android:color, 而不是使用android:drawable
错误文件如下:
![在这里插入图片描述](https://img-blog.csdnimg.cn/a67de3bd671b499f85509ef0545c73ab.png)
改正后:
![在这里插入图片描述](https://img-blog.csdnimg.cn/9ed9128b6f31474f8e71aa6bca89497c.png)
在selector中,android:color不会出现提示,经常忘记,再次记录