button with shadow that look like gradient in android xml -
i trying achieve button selector on press shadow removed..
but can seem close this..this shadow side , not reaching corners , can effect via xml ?
this xml close image
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:right="5dp" android:top="5dp" > <layer-list> <item android:right="5dp" android:top="5dp" > <shape> <corners android:radius="6dp" /> <gradient android:angle="45" android:endcolor="@color/white" android:startcolor="#d6d6d6" /> </shape> </item> <item android:right="5dp" android:top="5dp"> <shape android:shape="rectangle"> <solid android:color="@color/white"/> <corners android:radius="6dp" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> <stroke android:width="0.5px" android:color="@color/gray_50"/> </shape> </item> </layer-list> </item> <item> <layer-list> <item android:right="5dp" android:top="5dp" > <shape> <corners android:radius="6dp" /> <gradient android:angle="45" android:endcolor="@color/white" android:startcolor="#d6d6d6" /> </shape> </item> <item android:bottom="2dp" android:left="2dp"> <shape android:shape="rectangle"> <solid android:color="@color/white"/> <corners android:radius="6dp" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> <stroke android:width="0.5px" android:color="@color/gray_50"/> </shape> </item> </layer-list> </item> </selector>
try using background.
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <solid android:color="#fff" /> <corners android:radius="4dp" /> </shape> </item> <item android:bottom="1dp"> <shape android:shape="rectangle" > <corners android:radius="4dp" /> <stroke android:width="1dp" android:color="#dadad7" /> <solid android:color="#fff" /> </shape> </item> </layer-list>
i hope work
Comments
Post a Comment