Applying shadow to custom grid view



I want to apply shadow to each cell of my custom grid view.


I want the output to be something like this:-


Desired Output


See the shadow below each cell, I want the shadow on each cell of my grid view like that.


My code:-



<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://ift.tt/nIICcg" >
<item >

<shape
android:shape="rectangle">

<corners
android:radius="5dp"/>
<gradient
android:startColor="#202020"
android:endColor="#454545"
android:angle="270"/>

</shape>
</item>

<item
android:bottom="5dp">
<shape
android:shape="rectangle">

<solid
android:color="#202020"/>
<corners
android:radius="3dp"/>
<stroke
android:width="1dp"
android:color="#ffffff" >
</stroke>
</shape>
</item>


</layer-list>


Can anyone point out the improvement to this code. Thanks.


No comments:

Post a Comment