How to use Shadows?

Asked

Viewed 45 times

1

How to use the Shadows effect on my components?

inserir a descrição da imagem aqui

1 answer

3


It could be so:

<?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>

Other possibilities

  • Yes but where do I put this xml?

  • In the res drawable folder

  • More in the component I put as? Background?

  • Yes. Add this to the background of the component.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.