Notice
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Mail Server
- xe
- curl
- soundpool
- html5
- 안드로이드
- not working
- 설치
- 우분투
- dovecot
- C# IO
- php 시큐어코딩
- 안드로이드 푸시
- 자동 생성
- android 효과음
- 폼메일
- UML
- WebView
- C#
- mysql
- 안드로이드 gcm
- PHP
- FCM
- 자바스크립트
- Android
- chart.js
- roundcube
- php 취약점
- 안드로이드 푸쉬
- javascript
Archives
- Today
- Total
그러냐
안드로이드 이미지 뷰 여백 없애기 본문
반응형
ScorllView에 ImageView를 넣었을 때 위 아래로 여백이 생기는 것을 확인했습니다.
이를 제거하기 위해 ScaleType을 모두 적용했지만 원하는데로 적용되지 않았습니다.
해결 방법은 간단합니다.
스크롤 뷰, 이미지 뷰 레이아웃 너비, 높이를 모두 match_parent로 설정하고
이미지 뷰에 다음과 같이 추가합니다.
android:adjustViewBounds="true"
이미지 보다 레이아웃이 더 클 때 비율을 유지하는 여부를 묻는 속성입니다.
true로 설정하면 이미지가 레이아웃에 딱 맞게 설정되어 표시됩니다.
아래 전체 xml 코드입니다.
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/..."
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"/>
</ScrollView>
이상 이미지 뷰 여백 없애기였습니다.
출처: https://yeolco.tistory.com/48 [열코의 프로그래밍 일기]
반응형
'android' 카테고리의 다른 글
| 안드로이드 풀 스크린 모드 (0) | 2020.03.23 |
|---|---|
| 안드로이드 확장자별 파일 열기 (0) | 2019.08.22 |
| Google Play 안전하지 않은 onReceivedSslError 경고 대응하기 (0) | 2019.02.27 |
| 안드로이드 웹뷰 모바일 뷰 로드 (0) | 2019.02.20 |
| Cannot find a version of 'com.android.support:support-annotations' that satisfies the version constraints (0) | 2019.02.13 |