ビューフリッパーを使用して異なるxmlを表示し、各xmlにラジオボタンが含まれていると問題が発生します。したがって、実際には2つの状況にあり、どちらかの方法で作業する必要があります。状況 1:
2 x 2 のラジオ ボタンが必要です。これは、2 x 2 の位置にある合計 4 つのラジオ ボタンを意味し、そのうちの 1 つを選択する必要があり、他の 3 つはチェックされていません。私の質問は、ラジオボタンがすべて同じグループにあることをxmlで作成する方法ですが、なんとか4つのラジオボタンを作成することができ、それらはすべて同じグループのカテゴリにはなりません。Any1 は、それらを 1 つのラジオ グループに分類する方法を教えてくれますか?
Codes:
<RadioGroup
android:id="@+id/rg1"
android:layout_height="0dp"
android:layout_width="fill_parent"
android:baselineAligned="false"
android:layout_weight="2.5"
android:orientation="horizontal">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="1">
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:checked="true"
android:text="@string/radio1"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio2"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="1">
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio3"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
<RadioButton
android:id="@+id/radio3"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio4"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
</LinearLayout>
</RadioGroup>
状況 2:
The second Situation is that I try clearing the radio buttons using codes nut somehow when I flip to another xml with the same radio button and id but it wont work.
PS: Sorry for my bad command of english