作者:手机用户2502858701 | 来源:互联网 | 2023-05-19 06:30
在代码中动态设置了TextView的颜色选择器holder.bt_buy.setTextColor(mcontext.getResources().getColor(R.color.se
在代码中动态设置了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"