ListView控件可点击/编辑插件 [英] ListView with clickable/editable widget
问题描述
是否有可能使用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
可点击的项目(右侧的电话图标)。
<一href="https://github.com/android/platform_packages_apps_contacts/blob/donut-release/src/com/android/contacts/RecentCallsListActivity.java#L380">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
这篇关于ListView控件可点击/编辑插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!