How to change color of ListView items on focus and on click

前端 未结 7 1801
天命终不由人
天命终不由人 2020-11-27 03:44

i have a list View in my app (this is the xml layout):

   


        
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 04:23

    The child views in your list row should be considered selected whenever the parent row is selected, so you should be able to just set a normal state drawable/color-list on the views you want to change, no messy Java code necessary. See this SO post.

    Specifically, you'd set the textColor of your textViews to an XML resource like this one:

    
    
         
         
         
         
     
    

提交回复
热议问题