Ответ 1
Uh, это означает "индекс столбца, в котором должен быть этот ребенок". Единственная сложная часть состоит в том, что столбцы начинаются с 0.
Например:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<TextView
android:text="URL:" />
<EditText android:id="@+id/entry"
android:layout_span="3"/>
</TableRow>
<TableRow>
<Button android:id="@+id/cancel"
android:layout_column="2"
android:text="Cancel" />
<Button android:id="@+id/ok"
android:text="OK" />
</TableRow>
</TableLayout>
Обе строки в приведенном выше расположении имеют четыре столбца. Первый имеет четыре столбца, потому что он имеет TextView
в столбце 0 и EditText
, охватывающий столбцы 1, 2 и 3. Второй имеет четыре столбца, потому что он пропускает столбцы 0 и 1 и помещает два Button
виджетов в столбцах 2 и 3, с учетом атрибута android:layout_column="2"
в первом Button
.