TextView 设置颜色无效

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

1. 解决:

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

radioButton.setTextColor(colors);  

2. TextView 使用别的style

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

 

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

posted @ 2015-07-22 20:00  pandans  阅读(872)  评论(0编辑  收藏  举报