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

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -