简体   繁体   English

Android ListView 与自定义行(RadioButton 和 3 TextView)

[英]Android ListView with custom row (RadioButton and 3 TextView)

i am using a listview in a class which extends ListActivity but my row have a radio button and 3 textviews.我在扩展 ListActivity 的 class 中使用列表视图,但我的行有一个单选按钮和 3 个文本视图。

If i delete radiobutton from it, the metod onListItemClick(ListView l, View v, int position, long id) works well and i see what item have been selected but with the radiobutton i can check what item have selected.如果我从中删除单选按钮,则方法onListItemClick(ListView l, View v, int position, long id)运行良好,我可以看到已选择的项目,但使用单选按钮我可以检查已选择的项目。

How i can resolve this?我该如何解决这个问题? I am using a custom adapter for build listview我正在使用自定义适配器来构建列表视图

I think you need multi selection in the ListView that is why you're trying achieve that using RadioButton, if so, instead of RadioButton,try Checkbox, that would work great我认为您需要在 ListView 中进行多项选择,这就是为什么您尝试使用 RadioButton 来实现这一点,如果是这样,而不是 RadioButton,请尝试 Checkbox,这样会很好用

and this tutorial will guide you how to accomplish that http://appfulcrum.com/2010/09/12/listview-example-3-simple-multiple-selection-checkboxes/本教程将指导您如何完成http://appfulcrum.com/2010/09/12/listview-example-3-simple-multiple-selection-checkboxes/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM