Change ListView's text color on click

前端 未结 1 2024
春和景丽
春和景丽 2020-12-19 18:52

I have a customized ListView that each row of the list is composed by an ImageView and two TextView\'s. I want to change the text\'s c

1条回答
  •  粉色の甜心
    2020-12-19 19:24

    Create a new StateListDrawable like you did before but with black as default color and white when pressed.

    
    
    
    
    
    
    

    Now for in the TextView change the text color to the new drawable:

    android:textColor="@color/list_item_text"
    

    More on StateListDrawables: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList

    0 讨论(0)
提交回复
热议问题