概述
在游戏中心项目中需要调textview的字体颜色,按下需要换一种颜色。
之前用
mCenterInstallStatus.setTextColor(mContext.getResources().getColor(
R.color.applistitem_button_text));
这样子是不对的,无法响应按下变色的需求。
需要改成如下:
mCenterInstallStatus.setTextColor(mContext.getResources().getColorStateList(
R.color.applistitem_button_text));
重点是要用getColorStateList
最后
以上就是活力大象为你收集整理的android 代码中设字体颜色selector的全部内容,希望文章能够帮你解决android 代码中设字体颜色selector所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复