본문 바로가기

APP DEVELOPER/Android 안드로이드

안드로이드 - 스크롤뷰 XML 스크롤이 생기는 VIEW

스크롤뷰 XML 스크롤이 생기는 VIEW

전체 페이지로 안하고 페이지 중간에 스크롤 뷰를 만들수도 있다.

거의 기본 샘플이다. 중간에 SWIPE 까지 있다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ScrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
 
 
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="300dp">
 
            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="상단" />
 
        </LinearLayout>
 
        android:id="@+id/my_pager"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="#FF00FF"
        android:fadingEdge="vertical" />
 
 
 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="300dp">
 
        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="하단" />
 
    </LinearLayout>
 
</LinearLayout>
</ScrollView>