ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 안드로이드 스크롤뷰(scrollView)
    program_language 및 궁금한것/Android Studio 2018. 7. 29. 15:45

    minmap: 런처 아이콘

    drawable: 이미지 넣는곳

    하나의 스크롤뷰에는 하나의 객체만 들어갈수 있음

    여러개를 넣으려면 linearLayout등 스크롤뷰에 넣으면 됨


    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView 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"
    tools:context=".MainActivity">
    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <TextView
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:background="#ff0000"
    android:gravity="center"
    android:text="FF0000"
    android:textSize="30dp" />
    <TextView
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:background="#37ff00"
    android:gravity="center"
    android:text="00FF00"
    android:textSize="30dp" />
    <TextView
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:background="#0037ff"
    android:gravity="center"
    android:text="0000FF"
    android:textSize="30dp" />
    <HorizontalScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/a"
    android:scaleType="fitXY"
    android:adjustViewBounds="true"
    />
    <ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/b" />
    <ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/c"
    android:scaleType="fitXY"/>
    </LinearLayout>
    </HorizontalScrollView>
    </LinearLayout>
    </ScrollView>


    반응형

    댓글

Designed by Tistory.