Reputation: 43
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:
Upvotes: 1
Views: 1195
Reputation: 130
I Would suggest you create a drawable as per your requirement and add it to the bottom of the view.
Upvotes: 0
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-List
specific reference SDK doc
Upvotes: 1