안드로이드 개발 질문/답변
(글 수 45,052)
ImageView에 기본 Icon을 리소스로 지정하면,
아이콘 영역만큼 ImageView의 영역이 잡히는데요.
큰사이즈(650*470)의 이미지를 설정하면,
아래와 같이 ImageView의 영역이 너무크게 잡히네요.
(회색부분이 실제 이미지이고, Test버튼 위까지가 ImageView의 영역입니다.)
화면에 보이는 이미지 사이즈 만큼만,
ImageView의 영역을 잡으려면 어떻게 해야하죠?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/rmap_01"
android:scaleType="fitStart"
/>
<Button
android:id="@+id/btn_enter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"
/>
</LinearLayout>




ImageView 속성중에 android:adjustViewBounds="true" 를 주세요.