내가 첫 번째 행에 다음과 같습니다 버튼 레이아웃 만들기 위해 노력하고 있습니다 :안드로이드 GridLayout과 - XML - 열하지 비례
[ 1 ][2][3]
버튼 1 버튼 2 배의 폭을 2 열을 점유하고 있어야한다 3. 버튼 2와 3은 동일한 너비 (1 열 너비) 여야합니다.
그러나, 내가 무엇을보고하고하는 것은 이것이다 : 버튼 3을 완전히 화면의 나머지 부분을 채우고 왜 버튼을 layout_column_span 규칙을 순종하는 것 같지 않는 이유
[1][2][ 3 ]
누군가가 말해 주시겠습니까? 그것은 GridLayout
에 적지 않은 방식으로 공간을 배치에 관해서
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_margin="0dp"
android:adjustViewBounds="true"
android:alignmentMode="alignMargins"
android:clipToPadding="false"
android:columnCount="4"
android:fitsSystemWindows="false"
android:layoutMode="clipBounds"
android:orientation="horizontal"
android:padding="0dp"
android:rowCount="6"
android:useDefaultMargins="true" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:layout_weight="1"
android:layout_margin="0dp"
android:background="#ff0000"
android:layout_row="0"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_rowSpan="2"
android:text="1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:layout_weight="1"
android:layout_margin="0dp"
android:background="#ffff00"
android:layout_row="0"
android:layout_column="2"
android:layout_columnSpan="1"
android:layout_rowSpan="2"
android:text="2" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:layout_columnSpan="1"
android:layout_gravity="fill"
android:layout_margin="0dp"
android:layout_row="0"
android:layout_rowSpan="2"
android:layout_weight="1"
android:background="#00ff00"
android:text="3" />
</GridLayout>
감사합니다. 그러나 GridLayout을 사용하고 싶습니다. – SparkyNZ