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 bottom
, left
, right
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
'android' 카테고리의 다른 글
[Android] DialogFragment에 기본 padding값 제거하는 방법 (0) | 2019.01.29 |
---|---|
[Android] Type parameter T Has Incompatible upper bounds ViewDataBinding 대처 (0) | 2019.01.29 |
[Android] Design editor is unavailable until a successful build 에러 대처 (0) | 2019.01.25 |
[Android] gradient 를 사용해 하단에 그림자 효과 넣기 (0) | 2019.01.25 |
[Android] @drawable resource 연결 후 failed linking file resources 대처 (0) | 2019.01.25 |