1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 
    <item
        android:bottom="-5dp"
        android:right="-5dp"
        android:top="-5dp">
        <shape android:shape="rectangle" >
            <solid android:color="@color/color_of_the_background" />
 
            <stroke
                android:width="5dp"
                android:color="@color/color_of_the_border" />
        </shape>
    </item>
 
</layer-list>
cs






this way only left border is visible but you can achieve any combination you want by playing with bottomleftright and top attributes of the item element




https://stackoverflow.com/questions/9211208/how-to-draw-border-on-just-one-side-of-a-linear-layout

https://stackoverflow.com/questions/9211208/how-to-draw-border-on-just-one-side-of-a-linear-layout

https://stackoverflow.com/questions/9211208/how-to-draw-border-on-just-one-side-of-a-linear-layout

+ Recent posts