Make linear layout selectable like a list item in a list view (Android)

后端 未结 3 1116
太阳男子
太阳男子 2021-02-02 11:01

I know how to add an onClick listener to a LinearLayout to make the whole layout a click target, but I\'d like to have the LinearLayout get highlighted when tapped just like a l

3条回答
  •  無奈伤痛
    2021-02-02 11:18

    I prefer a simpler way:

    
    
        
    
    

    You can't change the state-pressed background this way, but sometimes you don't really need to.

提交回复
热议问题