- Row, Column 구조의 테이블 화면을 만들기 위한 레이아웃
- orientation 속성을 이용해 뷰의 배치 방향 지정
- rowCount 혹은 columnCount 속성을 이용해 자동 개행 지정
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button android:text="1"/>
<Button android:text="2"/>
<Button android:text="3"/>
<Button android:text="4"/>
<Button android:text="5"/>
</GridLayout>
- layout_row, layout_column - 뷰의 위치지정
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:columnCount="3">
<Button android:text="1"/>
<Button android:text="2"/>
<Button android:text="3"
android:layout_row="1"
android:layout_column="1"/>
<Button android:text="4"/>
<Button android:text="5"/>
</GridLayout>
- layout_columnSpan, layout_rowSpan - 뷰가 여러칸을 차지하게 설정
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:columnCount="3">
<Button android:text="1"
android:layout_rowSpan="2"
android:layout_columnSpan="2"
android:layout_gravity="fill"/>
<Button android:text="2"/>
<Button android:text="3"/>
<Button android:text="4"/>
<Button android:text="5"/>
</GridLayout>