RadioGroup内にRadioButtonがあります。
ボタンの初期状態を設定すると問題が発生します
android:checked = "true"
RadioButton "F"を押しても、RadioButton"M"のチェックが外れないためです。
どのようにできるのか?なにが問題ですか?
コードは次のとおりです。
<RadioGroup
android:id="@+id/registrazione_utente_sesso"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="M"
android:textColor="#ff7415"
android:textSize="18sp" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13.33dp"
android:text="F"
android:textColor="#ff7415"
android:textSize="18sp" />
</RadioGroup>
画面:
初期状態(正しい):
RadioButton "F"を押したときの最終状態(間違っている):
ありがとう