且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择和取消选择单选按钮

更新时间:2022-01-11 22:19:04

使用RadioGroup中您可以将单选按钮。
下面是例子,如何您可以将使用RadioGroup中的单选按钮

You can group RadioButtons using the RadioGroup. Here is the example how you can group the RadioButtons using RadioGroup

<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>

有关详细信息,您可以参阅这个文件

For more information you can refer this document