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