ListView控件可点击/编辑插件控件、插件、编辑、ListView

2023-09-12 00:10:38 作者:对星星说晚安

是否有可能使用OnItemClickListener上时,项目布局有一个可点击/编辑控件(单选按钮,EditText上,或复选框)一个ListView?

Is it possible to use a OnItemClickListener on a ListView when the Items layout has a clickable/editable widget (RadioButton,EditText, or CheckBox)?

推荐答案

您可能想看一看的这个问题。有一个焦点的项在连续的ListView 引起 OnItemClickListener 不被调用。但是,这并不意味着你不能有一排可聚焦/点击的项目,也有一些变通办法像的这个。

You might want to take a look at this issue. Having a focusable item in a row of a ListView causes the OnItemClickListener NOT to be invoked. However, that does not mean you cannot have focusable/clickable items in a row, there are some workarounds like this one.

此外,您还可以看看通话记录画面。它有一个的ListView 可点击的项目(右侧的电话图标)。 See来源$ C ​​$ C这里

Also, you can take a look at the Call Logs screen. It has a ListView with clickable item(the call icon on the right). See Source code here