일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- BottomNavigationView
- Datastore
- android studio
- 주석
- 취업
- nav_graph
- Gradle
- 면접
- kotlin
- TypeConverter
- themes.xml
- 테마
- ViewModel
- asLiveData()
- electron
- 일렉트론
- fragment
- Navigation Component
- 안드로이드
- hilt
- Jetpack Compose
- 개발자
- room
- imageview
- Binding Adapter
- 스플래시
- recyclerview
- Android
- Livedata
- Safe Args
Archives
- Today
- Total
나만 보는 일기장
[Android] View에 터치 효과 넣기 본문
android:background="?attr/selectableItemBackground"
// 혹은
android:background="?attr/selectableItemBackgroundBorderless"
// +
android:clickable="true"
위 속성들을 넣어주면 됩니다.
selectableItemBackground와 selectableItemBackgroundBorderless의 차이는 아래와 같습니다.
![]() |
![]() |
selectableItemBackground는 View의 바운더리 내에서,
selectableItemBackgroundBorderless는 View의 크기에 상관 없이 터치 이펙트를 보여줍니다.
터치 효과의 색상 같은 속성의 커스마이즈를 위해서는 아래 링크를 참고하시길 바랍니다.
https://black-jin0427.tistory.com/79
'개발 > Android' 카테고리의 다른 글
[DataStore] Preference DataStore 사용하기 (0) | 2022.04.07 |
---|---|
[Room] Room의 구조와 사용법 (0) | 2022.04.04 |
[RecyclerView] 스와이프, 드래그&드롭 효과를 가진 RecyclerView 만들기 (0) | 2022.03.26 |
[TextView] 문자열 리소스를 통해 Html 스타일과 서식을 같이 사용하는 방법 (0) | 2022.03.08 |
Comments