Skip to content Skip to sidebar Skip to footer

Howto Draw A Half Border In Xml Android

I want to draw a border like this , Bordered Edittext my code is as follows: Copy

Solution 2:

Toufiq Akbar. You should use Vector drawable.

<vectorxmlns:android="http://schemas.android.com/apk/res/android"android:width="24dp"android:height="24dp"android:viewportHeight="400.0"android:viewportWidth="580.0"><pathandroid:fillColor="#00000000"android:pathData="M41.5,318L534.7,318"android:strokeColor="#000"android:strokeWidth="1.5" /><pathandroid:fillColor="#00000000"android:pathData="M535.5,210L535.5,319"android:strokeColor="#000"android:strokeWidth="1.5" /><pathandroid:fillColor="#00000000"android:pathData="M42.5,209L42.5,318"android:strokeColor="#000"android:strokeWidth="1.5" /></vector>

I think It is useful to you... :)

Solution 3:

<layer-listxmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:bottom="2dp"android:left="2dp"android:right="2dp"><!--// add android:right="5dp" and android:left="5dp" for border on left and right--><shapeandroid:shape="rectangle"><paddingandroid:bottom="5dp"android:left="5dp"android:right="5dp" /><solidandroid:color="@color/colorPrimary" /></shape></item><itemandroid:bottom="2dp"android:left="2dp"android:right="2dp"><shapeandroid:shape="rectangle"><strokeandroid:width="3dp"android:color="@color/red" /><sizeandroid:height="50dp" /><paddingandroid:bottom="10dp"android:left="5dp"android:right="5dp" /></shape></item><item><!--// add android:right="5dp" and android:left="5dp" for border on left and right--><shapeandroid:shape="rectangle"><paddingandroid:bottom="5dp" /><solidandroid:color="@color/colorPrimary" /></shape></item></layer-list>

Use this.

Post a Comment for "Howto Draw A Half Border In Xml Android"