도전2022
안드로이드 ImageView.ScaleType 설정 관련 본문
http://developer.android.com/intl/ko/reference/android/widget/ImageView.ScaleType.html
<ImageView
android:id="@+id/image1"
android:layout_width="match_parent"
android:layout_height="250px"
android:layout_weight="0.36"
android:scaleType="fitXY" />
java.lang.Object | ||
↳ | java.lang.Enum<E extends java.lang.Enum<E>> | |
↳ | android.widget.ImageView.ScaleType |
Class Overview
Options for scaling the bounds of an image to the bounds of this view.
Summary
Enum Values | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageView.ScaleType | CENTER | Center the image in the view, but perform no scaling. | |||||||||
ImageView.ScaleType | CENTER_CROP | Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). | |||||||||
ImageView.ScaleType | CENTER_INSIDE | Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). | |||||||||
ImageView.ScaleType | FIT_CENTER | Scale the image using CENTER . | |||||||||
ImageView.ScaleType | FIT_END | Scale the image using END . | |||||||||
ImageView.ScaleType | FIT_START | Scale the image using START . | |||||||||
ImageView.ScaleType | FIT_XY | Scale the image using FILL . | |||||||||
ImageView.ScaleType | MATRIX | Scale using the image matrix when drawing. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand] Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Enum | |||||||||||
From class java.lang.Object | |||||||||||
From interface java.lang.Comparable |
Enum Values
public static final ImageView.ScaleType CENTER
Center the image in the view, but perform no scaling. From XML, use this syntax: android:scaleType="center"
.
public static final ImageView.ScaleType CENTER_CROP
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop"
.
public static final ImageView.ScaleType CENTER_INSIDE
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerInside"
.
public static final ImageView.ScaleType FIT_CENTER
Scale the image using CENTER
. From XML, use this syntax: android:scaleType="fitCenter"
.
public static final ImageView.ScaleType FIT_END
Scale the image using END
. From XML, use this syntax: android:scaleType="fitEnd"
.
public static final ImageView.ScaleType FIT_START
Scale the image using START
. From XML, use this syntax: android:scaleType="fitStart"
.
public static final ImageView.ScaleType FIT_XY
Scale the image using FILL
. From XML, use this syntax: android:scaleType="fitXY"
.
public static final ImageView.ScaleType MATRIX
Scale using the image matrix when drawing. The image matrix can be set using setImageMatrix(Matrix)
. From XML, use this syntax:android:scaleType="matrix"
.
Public Methods
'소스코드' 카테고리의 다른 글
안드로이드 북 리스트 (0) | 2012.08.10 |
---|---|
안드로이드 갤러리 만들기 (0) | 2012.08.10 |
Android Supported Media Formats (0) | 2012.08.09 |
chromiumembedded A simple framework for embedding chromium browser windows in other applications. (0) | 2012.08.01 |
구글 크롬 위키백과, 우리 모두의 백과사전. (0) | 2012.08.01 |