make a splash
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
반응형
profile

make a splash

@vision333

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!