본문 바로가기

System Programmings/Android

[Android] 레이아웃의 좋은 예제

반응형

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:background="@color/bg">
 <TextView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="1"
  android:textColor="@color/text"
  android:textStyle="bold"
  android:gravity="center" />
 <LinearLayout
  xmlns:andxmlns="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_weight="1"
  android:layout_margin="5dp"
  android:gravity="center"
  android:background="#FFFFFFFF">
  <TextView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="2-1"
   android:textColor="@color/text"
   android:background="#d7bb27"
   android:layout_weight = "1"
   android:layout_gravity = "left|bottom"/>
  <TextView
   android:layout_width="wrap_content"
   android:layout_height="fill_parent"
   android:text="2-2"
   android:textColor="@color/text"
   android:background="#d7bb27"
   android:layout_weight="1"
   android:gravity="center" />
  <TextView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="2-3"
   android:textColor="@color/text"
   android:background="#d7bb27"
   android:layout_weight="1"
   android:layout_gravity="center"
   android:gravity="right" />
 </LinearLayout>
</LinearLayout>


출처 : http://myelf.egloos.com/2694773
반응형