Rishu
Rishu

Reputation: 43

I want to add shadow only on the left and right corners

I have tried shadowing the list view i can make all the four sides.. but what i need here to shadow only the left and right corners of the list view like one in the given below image:

enter image description here

Upvotes: 1

Views: 1195

Answers (2)

qwertygamer
qwertygamer

Reputation: 130

I Would suggest you create a drawable as per your requirement and add it to the bottom of the view.

Upvotes: 0

LittleMice
LittleMice

Reputation: 11

I think you can use a covering way.The foreground layer is covered on the background layer and sets the padding of the foreground layer to expose the background layer only to the gradient edge.

<?xml version="1.0" encoding="utf-8"?>  
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >  
    <!-- layout background -->  
    <item>  
        <!-- show rectangle area -->  
        <shape android:shape="rectangle" >  
            <gradient  
                android:angle="270"  
                android:startColor="#FFFFFF"  
                android:centerColor="#000000"  
                android:endColor="#FFFFFF"/>  
        </shape>  
    </item>  
    <!-- layout foreground -->  
    <item  
        android:bottom="5px"  
        android:top="5px">  
        <!-- show rectangle area -->  
        <shape android:shape="rectangle" >  
            <solid android:color="#FFFFFF" />  
        </shape>  
    </item>  
</layer-list>  

You can also use Layer-Listspecific reference SDK doc

Upvotes: 1

Related Questions