This article illustrates the way Android programming uses custom shape to implement shadow shadow effects. Share to everyone for your reference, specific as follows:
directly on the XML file, and attach the corresponding parsing:
<?xml version= "1.0" encoding= "Utf-8"?> <selector xmlns:android= "http://schemas.android.com/apk/res/" Android "> <item android:state_pressed=" true "> <layer-list> <!--equivalent to padding--> <item Andr oid:left= "4DP" android:top= "4DP" > <shape> <solid android:color= "#ff58bb52"/> <corners and roid:radius= "30dip"/> </shape> </item> </layer-list> </item> <item> <laye r-list> <!--SHADOW LAYER--> <item android:left= "4DP" android:top= "4DP" > <shape> <
Solid android:color= "#66000000"/> <corners android:radius= "30dip"/> </shape> </item> <!--CONTENT LAYER--> <!--equivalent to padding--> <item android:bottom= "4DP" android:right= "4DP" >
;shape> <solid android:color= "#ff58bb52"/> <corners android:radius= "30dip"/> </shape> </item> </layer-list> </item> </selector>
I hope this article will help you with your Android programming.