Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 이미지짤림
- LazyInitialization
- 아키텍쳐패턴
- ImageView
- 이미지찌그러짐
- 구조패턴
- DistributedSystems
- 싱글톤패턴
- SDLC
- 시퀀스다이어그램
- stateflow
- android
- SharedFlow
- 행위패턴
- SoftwareArchitecture
- ArchitecturePatterns
- LayeredArchitecture
- Kotlin
- NetworkCommunication
- scaletype
- 옵서버
- threadsafety
- 유스케이스다이어그램
- 클래스다이어그램
- RxJava
- ClientServerArchitecture
- MVVM
- decoding
- SystemDesign
- 전역상태관리
Archives
- Today
- Total
Kyung_Development
android ImageView 이미지 scaleType 본문
ImageView 에 이미지를 설정하다보면 간혹 짤리거나 찌그러지는 경우가 있는데
scaleType을 설정해두면 해결되는 심플한 문제입니다.
scaleType
- center
이미지 원본 크기 유지, 중앙 배치. - centerCrop
이미지 중앙 기준, 뷰를 채우며 잘림 발생. - centerInside
이미지가 뷰 내부에 맞게 축소/중앙 배치, 넘치면 축소. - fitCenter
뷰 내부에 맞게 축소/확대, 중앙 정렬. - fitStart
뷰 내부에 맞게 축소/확대, 상단 정렬. - fitEnd
뷰 내부에 맞게 축소/확대, 하단 정렬. - fitXY
뷰 크기에 강제로 맞춤, 비율 무시. - matrix
직접 변환 설정 필요 (커스텀).
예제
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/your_image" />
'android > Layout' 카테고리의 다른 글
| [Layout] TextView 가운데 정렬 (0) | 2023.03.24 |
|---|---|
| [Layout] ImageView 여백 없애기 (0) | 2023.03.22 |