我需要一个解决方案,其中它表现为一个自然的单选按钮,在任何时间点只检查一个选项.解决方法 您可以使用RadioGroup对Radiobuttons进行分组.
以下是如何使用RadioGroup对Radiobuttons进行分组的示例
<RadioGroup androID:ID="@+ID/radioGroup1" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content"> <Radiobutton androID:text="Radiobutton" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:ID="@+ID/radio0" androID:checked="true"></Radiobutton> <Radiobutton androID:text="Radiobutton" androID:layout_wIDth="wrap_content" androID:ID="@+ID/radiobutton1" androID:layout_height="wrap_content"></Radiobutton></RadioGroup>
有关更多信息,请参阅this document
@H_301_26@ 总结以上是内存溢出为你收集整理的android – 选择和取消选择单选按钮全部内容,希望文章能够帮你解决android – 选择和取消选择单选按钮所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)