Android - Make background with shadow - Drawable
Create drawable file:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:height="30dp"
android:gravity="bottom"
>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="@android:color/transparent"
android:endColor="#000000">
</gradient>
<corners android:radius="5dp"/>
</shape>
</item>
<item
android:left="0dp"
android:right="0dp"
android:top="0dp"
android:bottom="3dp">
<shape android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<corners android:radius="2dp"/>
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:height="30dp"
android:gravity="bottom"
>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="@android:color/transparent"
android:endColor="#000000">
</gradient>
<corners android:radius="5dp"/>
</shape>
</item>
<item
android:left="0dp"
android:right="0dp"
android:top="0dp"
android:bottom="3dp">
<shape android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<corners android:radius="2dp"/>
</shape>
</item>
</layer-list>
Nhận xét
Đăng nhận xét