Programming/Android

안드로이드 레이아웃 예제

TanSanC 2013. 3. 16. 16:40

<LinearLayout 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:orientation="vertical"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/page1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Page1" />

        <Button
            android:id="@+id/page2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
             android:text="Page2" />

        <Button
            android:id="@+id/page3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

 android:text="Page3" />
   </LinearLayout>

    <FrameLayout
        android:id="@+id/frame_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
        <LinearLayout
            android:id="@+id/frame_01"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ff0000" >
        </LinearLayout>
        <LinearLayout
            android:id="@+id/frame_02"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#00ff00" >
        </LinearLayout>
        <LinearLayout
            android:id="@+id/frame_03"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#0000ff" >
        </LinearLayout>
    </FrameLayout>

</LinearLayout>