본문 바로가기

Android

이미지 뷰(imageView) - 확대 모드

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:id="@+id/ScrollView1"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:paddingBottom="@dimen/activity_vertical_margin"

    android:paddingLeft="@dimen/activity_horizontal_margin"

    android:paddingRight="@dimen/activity_horizontal_margin"

    android:paddingTop="@dimen/activity_vertical_margin"

    tools:context=".MainActivity" >

 

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:orientation="vertical" >

 

        <LinearLayout

            android:layout_width="fill_parent"

            android:layout_height="fill_parent"

            android:orientation="vertical" >

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="wrap, wrap. no scaletype" />

 

            <ImageView

                android:id="@+id/img"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100, no scaletype" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="50, 100, no scaletype" />

 

            <ImageView

                android:layout_width="50px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="fitStart" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="fitStart"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="fitCenter" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="fitCenter"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="fitEnd" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="fitEnd"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="fitXY" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="fitXY"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="330, 100 center" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="center"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="50, 100 center" />

 

            <ImageView

                android:layout_width="50px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="center"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="330, 100 centerCrop" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="centerCrop"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="50, 100 centerCrop" />

 

            <ImageView

                android:layout_width="50px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="centerCrop"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100 centerInside" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="centerInside"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="50, 100 centerInside" />

 

            <ImageView

                android:layout_width="50px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="centerInside"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="matrix" />

 

            <ImageView

                android:layout_width="300px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:scaleType="matrix"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100 adjustViewBounds = false" />

 

            <ImageView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:background="#cccccc"

                android:maxHeight="100px"

                android:maxWidth="300px"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100 adjustViewBounds = true" />

 

            <ImageView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:adjustViewBounds="true"

                android:background="#cccccc"

                android:maxHeight="100px"

                android:maxWidth="300px"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100 cropToPadding = false" />

 

            <ImageView

                android:layout_width="200px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:cropToPadding="false"

                android:padding="20dip"

                android:scaleType="centerCrop"

                android:src="@drawable/toycar" />

 

            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="300, 100 cropToPadding = true" />

 

            <ImageView

                android:layout_width="200px"

                android:layout_height="100px"

                android:background="#cccccc"

                android:cropToPadding="true"

                android:padding="20dip"

                android:scaleType="centerCrop"

                android:src="@drawable/toycar" />

        </LinearLayout>

    </LinearLayout>

 

</ScrollView>







'Android' 카테고리의 다른 글

캔버스(canvas)  (0) 2013.03.29
이미지 뷰(ImageView) - 이미지 버튼(ImageButton)  (0) 2013.03.28
버튼 - 토글(toggle)  (0) 2013.03.28
버튼 - 라디오버튼  (1) 2013.03.28
버튼 - 콤보박스  (0) 2013.03.28