简体   繁体   English

如何在展开式列表视图中实现单选按钮

[英]How to implement radio button in Expandable listview

I am developing an application in which I want to implement radio button inside expandable list view row. 我正在开发一个应用程序,在其中我要在可扩展列表视图行内实现单选按钮。 And on radio button selection I need to retrieve the value of that particular row item in which my radio button is exist. 在选择单选按钮时,我需要检索单选按钮所在的特定行项目的值。 And at a time only one radio button should select through the list of all items. 一次只能在所有项目列表中选择一个单选按钮。

my screen shot is attached with this question. 我的屏幕截图随附此问题。

Thanks in Advance 提前致谢

You surely should't add Child radio group from xml.. try adding it at run time... then just keep all 您肯定不应该从xml添加子级广播组。尝试在运行时添加它...然后仅保留所有

those children in a Some key value pair (Child position as key and RadioButton Object).. Now you don't 某个键值对中的那些子项(将子项位置作为键和RadioButton对象)。现在,您不必

need uniqueness since You have reference to all RadioButtons.. I had same issue and I did this, now it 需要唯一性,因为您已经引用了所有RadioButtons。我遇到了同样的问题,现在我做了

works great.. it becomes easy for handling these since you always get childPosition in 效果很好..由于您总是得到childPosition,因此处理起来很容易

ExpandibleListView thus making it easy to access.. ExpandibleListView使其易于访问。

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

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