ListView and propagating click events from children views in the items

后端 未结 2 743
生来不讨喜
生来不讨喜 2021-01-22 16:03

I have a ListView with custom items - 3 ImageViews and a TextView. I have a call to setItemsCanFocus(true), so I can make the ImageViews clickable. I\'m currently u

2条回答
  •  孤城傲影
    2021-01-22 16:16

    Setting android:addStatesFromChildren="true" on the listview in your xml will send clicks on the child elements to the onItemClick method in the onItemClickListener connected to your listview.

提交回复
热议问题