How to set TextColor using setTextColor(ColorsStateList colors)

前端 未结 3 1098
北恋
北恋 2021-01-30 08:56

I need to change text color when state change(pressed, focus)...

How to set the text color of a TextView using ColorsStateList?

3条回答
  •  粉色の甜心
    2021-01-30 09:18

    you can also use ContextCompat to load a color state list

    ColorStateList colors = ContextCompat.getColorStateList(this,R.color.my_color_list);

提交回复
热议问题