60日間全力プログラミング

プログラミング初心者が二ヶ月間でどこまでいけるかを記録したプログラミング学習ブログ

Androidレイアウト入門終了

本当に簡単なレイアウトの使い方を学習しました。
 
  • Linearlayoutの使い方
  • android layout margin
  • android layout weight
  • Table layout
 
<TableLayout 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:stretchColumns="0,1"
android:background="#ff9988">

<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">

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

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

TableRow>

<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">

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

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="3" />
TableRow>

<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">

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

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

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


TableLayout>