Ideas:
Add one or more layers in your own definition shape, and stagger. You can display the shadow effect. To add three-dimensional sense, the button presses, setting only one layer. we can control the direction and size of the shadows by using top, bottom, right and left four parameters.
Relationship Diagram
Here you define two shadow effects:
Res/drawable-hdpi/shadow1.xml
<?xml version= "1.0" encoding= "Utf-8"?><selector xmlns:android= "Http://schemas.android.com/apk/res/android" > <item android:state_pressed= "True" > <layer-list> <item android:left= "4DP" android:top= "4DP" ><shape> <solid android:color= "#ff58bb52"/> <corners android:radius= "30dip"/> </shape></item> </layer-list> </item> <item> <layer-list> <!--first Floor--<item android:left= "4DP" android:top= "4DP" ><shape> < Solid android:color= "#66000000"/> <corners android:radius= "30dip"/> <! --stroke--<stroke android:width= "1DP" android:color= "#ffffffff"/> </SHAPE&G T;</item> <!--Second Floor--<item android:bottom= "4DP" android:right= "4DP" ><shape> ; <Solid android:color= "#ff58bb52"/> <corners android:radius= "30dip"/> < !--Stroke--<stroke android:width= "1DP" android:color= "#ffffffff"/> </shape& Gt;</item> </layer-list></item></selector>
/testaa/res/drawable-hdpi/shadow2.xml
<?XML version= "1.0" encoding= "Utf-8"?
><selector xmlns:android= "Http://schemas.android.com/apk/res/android" > <!--click and <item Android : state_pressed= "true" > <layer-list> <item android:left= "4DP" android:top= "4DP" > <shape> <solid android:color= "#f F58bb52 "/> <corners android:radius=" 3DP "/> </shape > </item> </layer-list></item> <!--normal state--<item> <l Ayer-list> <!--First Floor--<item android:left= "2DP" Android : top= "2DP" > <shape> <solid android:color= "#66000000" /> <corners android:radius= "3DP"/> </shape> </item> <!--second--<item android:bottom= "4DP" android:right= "4DP" ; <shape> <solid android:color= "#ff58bb52"/> < Corners android:radius= "3DP"/> </shape> </item> <!--third Floor--<item android:bottom= "6DP" android:right= "6DP" > <shape> <solid android:color= "#ffcccccc"/> <corners android:radius= "3DP"/> </shape> </ITEM&G T </layer-list> </item></selector>
:
Shadow effect for graphic in Android (Shadow-effect-with-custom-shapes)