How to make shadow in layer-list?

谁说我不能喝 提交于 2019-12-06 05:45:38

Here you go:

Change your drawable background to:

<?xml version="1.0" encoding="utf-8"?><!-- Bottom 2dp Shadow -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#027668" />
            <corners android:radius="12dp" />
        </shape>
    </item>

    <!-- White Top color -->
    <item android:bottom="4dp">
        <shape android:shape="rectangle">
            <solid android:color="#20a18b" />
            <corners android:radius="7dp" />
            <stroke
                android:width="2dp"
                android:color="#027668" />
        </shape>

    </item>
</layer-list>

The results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!