android - Shape with only one transparent border -
i'm trying figure out how create shape right border transparent:
+ + + + + + + + + + + + + + + + + + +
i know how can that. @ moment have basic shape represents rectangle point i'm not sure if it's possible want:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#07000000" /> <!-- transparent background --> <corners android:topleftradius="10dp" android:bottomleftradius="10dp" /> <stroke android:width="2dp" android:color="@android:color/white" /> </shape>
the main idea hide line dont want show. since have no option specify within shape
itself, have use layer-list
, define negative padding shift rectangle right side out of bounds. better have corners rounded not of them visible anyway. try code:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:right="-10dp"> <shape android:shape="rectangle"> <solid android:color="#07000000" /> <corners android:radius="10dp" /> <stroke android:width="2dp" android:color="@android:color/white"/> </shape> </item> </layer-list>
Comments
Post a Comment