он будет централизован флажок, независимо от того, является ли его ширина жестко или
аюсь создать TabeLayout с сеткой флажков. В верхней части находятся 2 заголовка, и каждая дополнительная строка состоит из метки и 2 флажков. Мне бы хотелось, чтобы таблица заполняла все доступное пространство, первый столбец должен быть ориентирован влево, а флажки и их заголовки центрировались внутри их столбцов. В приведенном ниже макете заголовки отображаются по центру, а флажки - нет. Я добавил цвет фона для одного из CheckBox, это демонстрирует, что CheckBox фактически вырос до заполнения своего столбца (поэтому он не будет центрироваться так, как нужно); несмотря на параметр макета "wrap_content".
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<TableLayout
android:stretchColumns="1,2"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow>
<TextView
android:text=""
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:text="First category"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:text="2nd category"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</TableRow>
<TableRow>
<TextView
android:text="Row 1: "
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<CheckBox
android:background="#FF001122"
android:layout_height="50dip"
android:layout_width="wrap_content"
android:gravity="center_horizontal">
</CheckBox>
<CheckBox
android:layout_height="50dip"
android:layout_width="wrap_content"
android:gravity="center_horizontal">
</CheckBox>
</TableRow>
</TableLayout>
</LinearLayout>