반응형
scaleType
이미지의 크기를 ImageView 영역에 어떻게 맞출지에 대한 속성
<ImageView
android:id="@+id/imgReviewListPhoto"
android:layout_width="180dp"
android:layout_height="180dp"
android:src="@drawable/coffeezoo_logo"
android:background="@drawable/image_view_round_corner"
android:scaleType="centerCrop"/> //이부분
- MATRIX = 원본 크기 그대로 보여줌 (왼쪽상단 정렬)
- CENTER = 원본 크기 그대로 보여줌 (가운데 정렬)
- CENTER_CROP = View 영역에 공백이 있으면 채워서 보여줌(비율유지)
- CENTER_INSIDE = View 영역을 벗어나면 맞춰서 보여줌(비율유지)
- FIT_START = View 영역에 맞게 보여줌 (왼쪽상단 정렬, 비율유지)
- FIT_CENTER = View 영역에 맞게 보여줌 (가운데 정렬, 비율유지)
- FIT_END = View 영역에 맞게 보여줌 (왼쪽하단 정렬, 비율유지)
- FIT_XY = View 영역을 가득 채워서 보여줌(비율유지 안함)
→ 사진의 크기가 일정하지 않은 관계로 대부분 Center_Crop 을 사용한다.
반응형
'Android > Android Kotlin' 카테고리의 다른 글
[Android Kotlin] 네이버 로그인 (0) | 2023.10.25 |
---|---|
[Android Kotlin] Firebase로 로그인 기능 구현 - 이메일 로그인 (0) | 2023.10.25 |
[Android Kotlin] LayoutManager 종류 (0) | 2023.10.25 |
[Android Kotlin] Realtime Database 사용법 (0) | 2023.10.25 |
[Android Kotlin] RecyclerView + LiveData, ViewModel, Firebase Realtime Database, DataBinding (0) | 2023.10.25 |