728x90
그림자를 주고 싶은 뷰의 elevation 주기
<TextView
android:id="@+id/myview"
...
android:elevation="2dp"
android:background="@drawable/myrect" />
drawable에 radius들어간 rectangle 추가하고 background에 둥근 모서리 적용
<!-- res/drawable/myrect.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#42000000" />
<corners android:radius="5dp" />
</shape>
[참고]
https://developer.android.com/develop/ui/views/theming/shadows-clipping
Create Shadows and Clip Views | Android Developers
Material design introduces elevation for UI elements. Elevation helps users understand the relative importance of each element and focus their attention to the task at hand. The elevation of a view, represented by the Z property, determines the visual…
developer.android.com
728x90
반응형
'Android Studio' 카테고리의 다른 글
[젯팩 컴포즈로 개발하는 안드로이드 UI] 4장 UI 요소 배치 (0) | 2023.07.05 |
---|---|
[젯팩 컴포즈로 개발하는 안드로이드 UI] 3장 컴포즈 핵심 원칙 자세히 알아보기 (0) | 2023.07.04 |
[젯팩 컴포즈로 개발하는 안드로이드 UI] 2장 선언적 패러다임 이해 (0) | 2023.07.01 |
[젯팩 컴포즈로 개발하는 안드로이드 UI] 1장 컴포즈 앱 첫 빌드 (0) | 2023.07.01 |
서버 Base Url 정보 숨기기 (0) | 2023.03.18 |