Making a LinearLayout act like an Button

前端 未结 10 2088
无人及你
无人及你 2020-11-29 19:09

I have a LinearLayout that I\'ve styled to look like a button, and it contains a few text/ImageView elements. I would like to make the whole

10条回答
  •  日久生厌
    2020-11-29 19:16

    This was helpful but if you want to put a background color and make linear layout clickable like the list item. Set the background with your preferred color and set foreground color to ?android:attr/selectableItemBackground, set focusable true, and clickable true

    sample code

       
    

提交回复
热议问题