출처: https://3months.tistory.com/307 [Deep Play]

안드로이드/연습

[Android] ViewFlipper

코딩하는 랄뚜기 2021. 8. 22. 22:27
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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/prvBtn"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="이전화면">
        </Button>
        <Button
            android:id="@+id/nextBtn"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="다음화면">
        </Button>
    </LinearLayout>
    <ViewFlipper
        android:layout_weight="90"
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ff0000">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="안녕1"/>
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#00ff00">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="안녕2"/>
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#0000ff">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="안녕3"/>
        </LinearLayout>
    </ViewFlipper>
</LinearLayout>

실행화면

 

 

'안드로이드 > 연습' 카테고리의 다른 글

[Android] Menu xml  (0) 2021.08.23
[Android] TapHost  (0) 2021.08.22
[Android] 스크롤뷰  (0) 2021.08.18
[Android] 슬라이딩드로어  (0) 2021.08.18
[Android] 자동완성텍스트뷰어  (0) 2021.08.18