List item with button not clickable anymore

后端 未结 6 1150
再見小時候
再見小時候 2021-02-02 12:23

I have a list item with a button inside.

When the button is shown, the list item is not clickable anymore. To make it clickable again, I have replaced the button with a

6条回答
  •  灰色年华
    2021-02-02 12:59

    The part of the link provided by @Matroska that answers the question:
    You must add

    android:descendantFocusability="blocksDescendants"
    

    to the parent ViewGroup that defines the layout of an item of your ListView.

    Note: this will no longer allow you to focus on the inner button with hardware buttons. (sorry, I cannot comment yet)

提交回复
热议问题