Example:
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="3"
tools:context=".MainActivity" >
<TextView
android:textSize="28sp"
android:text="@string/hello_world" />
<TextView
android:textSize="28sp"
android:background="#D0D0D0"
android:text="Cell 2" />
<TextView
android:textSize="28sp"
android:background="#B0B0B0"
android:layout_rowSpan="2"
android:text="Double Row Cell 3" />
<TextView
android:textSize="28sp"
android:background="#909090"
android:layout_columnSpan="2"
android:text="Double Column Cell 4" />
<TextView
android:textSize="28sp"
android:background="#505050"
android:text="Cell 7" />
<TextView
android:textSize="28sp"
android:background="#FF0000"
android:text="Cell 8" />
<TextView
android:textSize="28sp"
android:background="#00FF00"
android:text="Cell 9" />
<TextView
android:textSize="28sp"
android:background="#0000FF"
android:layout_columnSpan="2"
android:text="Double Column Cell 10" />
<TextView
android:textSize="28sp"
android:background="#E0E0E0"
android:text="Cell 12" />
</GridLayout>
![GridLayout thumbnail](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsj8ZzIkp-_RIvIPNpZD8ezPoh_Kxy0bDk3IHfzybenIoEJkz1SqmGqL1ruk9BciHndDSxe5BsZeU8i0yV-8wDn-pdNuYUUFr9oUDLNHp0BgS5pap5UAzqHvRI1b4fn8hfvfSDzJ-LvC4/s72-c/Android_GridLayout.png)
0 comments:
Post a Comment