【发布时间】:2015-05-01 09:04:30
【问题描述】:
我想在我的应用程序中放置两个单选按钮(男性和女性)。
我这样做是使用单选按钮(不是组),但问题是: 一个按钮不能取消选中也可以同时选中
RadioButton 组是一组三个按钮,我只需要两个。有没有办法让他们成为两个?
那么有什么帮助吗?
【问题讨论】:
标签: android radio-button
我想在我的应用程序中放置两个单选按钮(男性和女性)。
我这样做是使用单选按钮(不是组),但问题是: 一个按钮不能取消选中也可以同时选中
RadioButton 组是一组三个按钮,我只需要两个。有没有办法让他们成为两个?
那么有什么帮助吗?
【问题讨论】:
标签: android radio-button
试试这个:
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Male"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Female"/>
</RadioGroup>
【讨论】: