TextView 设置颜色无效

经过代码setTextColor时 若是color是一个资源文件 ,则只会显示默认效果。不会有选择器效果html

1. 解决:java

ColorStateList colors = getContext().getResources().getColorStateList(R.color.radio_txt);  xml

radioButton.setTextColor(colors);  htm

2. TextView 使用别的styleblog

mTxtView = new TextView(getContext(), null, R.attr.vpiTabPageIndicatorStyle);资源

 

从string.xml取html格式的字符无效果get

相关文章
相关标签/搜索