0
的main.xml中文件代码:什么是“android:layout_column”属性?
<TableRow
android:id="@+id/TableRow01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:text="User"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<EditText
android:text=""
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></EditText>
<TextView
android:text="Test"
android:id="@+id/usernameTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></TextView>
</TableRow>
<TableRow
android:id="@+id/TableRow05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:text="Hobby"
android:id="@+id/hobby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<CheckBox
android:text="A"
android:id="@+id/reading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
></CheckBox>
<CheckBox
android:text="B"
android:id="@+id/swimming"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
></CheckBox>
</TableRow>
我已经在官方Android文档看,从中我了解到,android:layout_column
手段这个孩子应该在哪一列的索引。我已经设置了两个CheckBox
:android:layout_column = "1"
属性,所以我认为这两个CheckBox
都应该在第二列(索引:1)。但令我惊讶的是,第一CheckBox
是在第二列,第二CheckBox
是在第三列,就像你可以在下面看到:
任何人都可以解释,为什么?