2015-11-01 AndroidのUI - TableLayout ┗━UI Android tableLayout.xml <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TableLayout android:id="@+id/TableLayout_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:shrinkColumns="1" android:stretchColumns="2"> <!-- 1行目 --> <Button android:text="一行を占める" /> <!-- 2行目 --> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="通常ボタン" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="縮小" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="拡張" /> </TableRow> </TableLayout> <TableLayout android:id="@+id/TableLayout_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:collapseColumns="1"> <!-- 1行目 --> <Button android:text="一行を占める" /> <!-- 2行目 --> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="通常ボタン" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="隠蔽" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="拡張" /> </TableRow> </TableLayout> <TableLayout android:id="@+id/TableLayout_3" android:layout_width="match_parent" android:layout_height="wrap_content" android:stretchColumns="1,2"> <!-- 1行目 --> <Button android:text="一行を占める" /> <!-- 2行目 --> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="通常ボタン" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="拡張" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="拡張" /> </TableRow> <!-- 2行目 --> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="通常ボタン" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="拡張" /> </TableRow> </TableLayout></LinearLayout>