Как описано в заголовке, я пытаюсь объединить сетку 3х3 радиокнопки в одну группу радио. В предыдущем заданном вопросе я узнал, что для переключателей, соответствующих одной группе, они должны быть непосредственными детьми радиогруппы, которым они будут соответствовать. Я усвоил это, когда попытался инкапсулировать весь формат таблицы (с помощью переключателей в строках таблицы) в группе радио.
Забегая в эту стену, я попробовал следующее:
<TableLayout android:id="@+id/table_radButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title_radGroup_buffer">
<TableRow>
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/radGroup1">
<RadioButton android:id="@+id/rad1"
android:text="Button1"
android:layout_width="105px"
android:layout_height="wrap_content"
android:textSize="13px"></RadioButton>
<RadioButton android:id="@+id/rad2"
android:text="Button2"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
<RadioButton android:id="@+id/rad3"
android:text="Button3"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
</RadioGroup>
</TableRow>
<TableRow>
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/radGroup1">
<!-- snippet -->
</TableRow>
<!-- snippet --->
</TableLayout>
Очевидно, я не учился в первый раз, потому что снова столкнулся с стеной. Я надеялся, что радиокнопки в разных строках таблицы заметят, что они были частью одной и той же группы радиостанций (каждая группа имела одинаковый идентификатор), но это не сработало.
Есть ли способ сгруппировать все эти кнопки в одну группу радиостанций и сохранить структуру 3x3 (3 строки, 3 переключателя в каждой строке)?