android - How to make Shape like this? -
i want shape similar can see below. thing missing header color (the color behind anonymous text). i've reproduced wanted moving mouse on second textview highlighted , makes effect :)
current code:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke android:width="2dp" android:color="#000000" /> <gradient android:startcolor="#898989" android:endcolor="#b5b5b5" android:angle="270"/> <corners android:bottomrightradius="7dp" android:bottomleftradius="7dp" android:topleftradius="7dp" android:toprightradius="7dp"/> </shape> 
you need use layer list contains 2 drawables.
for example, first cover whole shape, , second overlay android:top="10dp" set, create offset showing underlying first shape
edit:
so:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <stroke android:width="2dp" android:color="#000000" /> <solid android:color="#00ff00" /> <corners android:bottomleftradius="7dp" android:bottomrightradius="7dp" /> </shape> </item> <item android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="20dp"> <shape android:shape="rectangle" > <gradient android:angle="270" android:endcolor="#b5b5b5" android:startcolor="#898989" /> <corners android:bottomleftradius="7dp" android:bottomrightradius="7dp" /> </shape> </item> </layer-list>
Comments
Post a Comment