Square Shape Shadow XML (SSSX)


SSSX:   SOLD       




Hi dev, recently I had difficulty realizing an ui design that uses a box and there are services there. Of course this will be complex if I use Cardview, because I have to apply at least a relative layout, so I decide to make a shape drawable that will be easy to use in any layout.

As an illustration, this is the preview

Here is the code

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

    <item
        android:left="0dp"
        android:right="0dp"
        android:top="0dp"
        android:bottom="2dp">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="2dp" />
        </shape>
    </item>
</layer-list>

Post a Comment

Previous Next

نموذج الاتصال