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 |
Tags
- ArrayList
- 안드로이드
- nav_graph
- 뷰바인딩
- ButtonWithButton
- 안드로이드 스튜디오
- ROOM
- 코틀린
- androidstudio
- MaterialButton
- button
- 안드로이드스튜디오
- firebasefunctions
- Dialog
- firebase
- Kotlin
- RealtimeDB
- Android
- textview
- EditText
- OutlinedButton
- 밑줄
- 랜덤ID
- Activity
- FRAGMENT
- lifecyclescope
- ViewModel
- BottomSheetDialog
- 팝업액티비티
- Imageview
Archives
- Today
- Total
안드로이드 앱 개발
이미지뷰나 이미지버튼 크기에 배경이미지 맞추기 본문
ImageView나 ImageButton에 원하는 이미지를 넣을때
크기를 맞추느라 애먹은 적이 있다.
각 view들의 width나 height를 조절해도 실제 이미지크기가 다르면 잘리거나
정렬이 안맞기 때문이다.
따라서 각 뷰의 속성에
아래 속성들을 추가해주면 된다.
android:adjustViewBounds="true" // 뷰의 경계값 인식
android:scaleType="fitCenter" //가운데 정렬