There is a checkbox in the item of listview. Causes and solutions of setonitemclick failure

1: Root layout settings for item

Android: clickable = "true", and then the item click event will become invalid. Set Android: descendantfocusability = "blocksdecedents" for the root layout and check@R_ 562_ 2419 @ setting Android: focusable = "false" will not work, so do not set Android: clickable = "true" for the item root layout

2: Set Android: descendantfocusability = "blocksdecedents" for the item root layout

Beforedescendants: ViewGroup will take precedence over its subclass controls and get the focus. Afterdescendants: ViewGroup can get the focus only when its subclass controls do not need to get the focus. Blocksdecedents: ViewGroup will override the subclass controls and get the focus directly

III: check@R_ 562_ 2419 @ set Android: focusable = "false"

The above is a brief introduction to you. The listview item contains check@R_ 562_ 2419 @, the causes and solutions of setonitemclick failure. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>