Android Studio

TableLayout

GOD03219 2018. 2. 1. 09:54

 

<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ff0000"
android:stretchColumns="0,1,2"> <!--- 행 0, 1, 2 번째가 width 를 동등하게 배분 -->

<TableRow>

<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

</TableRow>

<TableRow>

<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

</TableRow>

<TableRow>

<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_span="3"/> <!-- 버튼 3개의 자리 차지-->


</TableRow>





</TableLayout>