<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rg"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.radiogroup.MainActivity" >
<RadioButton
android:id="@+id/rb_true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical" />
<RadioButton
android:id="@+id/rb_false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical" />
</RadioGroup>
我有一个单选框组,其中包含2个单选按钮
现在,如果选择单选按钮1,如果我再次点击同一单选按钮(单选按钮1),它应该被取消选择。
它应该像切换一样工作。