У меня есть несколько переключателей, которые я хочу разместить с помощью таблицы, но также включаю их в одну группу радио. У меня есть следующий XML-макет:
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/Group1">
<TableLayout android:id="@+id/RadioButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow>
<RadioButton android:id="@+id/rad1"
android:text="RButton1"
android:layout_width="105px"
android:layout_height="wrap_content"
android:textSize="13px"></RadioButton>
<RadioButton android:id="@+id/rad2"
android:text="RButton2"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
<RadioButton android:id="@+id/rad3"
android:text="RButton3"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
</TableRow>
</TableLayout>
</RadioGroup>
Но, к сожалению, радиокнопки внутри таблицы, похоже, игнорируют тот факт, что они находятся внутри тегов RadioGroup, и из-за этого вы можете выбрать одновременно несколько радиокнопек. Я заметил, что, удалив таблицу и просто используя радиокнопки, она работает нормально. Как я могу это преодолеть? Было бы так же просто, как объявить радиогруппу внутри таблицы вместо внешней? Спасибо за любую помощь.