This is my XML code which works fine, the only problem is it's showing border on all four sides while I want only to show border on the top and on the bottom only. How can I do that?
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<stroke
android:width="3dip"
android:color="#B1BCBE"
/>
<padding
android:bottom="0dip"
android:left="0dip"
android:right="0dip"
android:top="0dip"
/>
</shape>
Try the below
Edit:
Modify the below according to your requirements by changing the color, stroke width and padding
Snap
use:
Try this:
Refer this code -
Its best not to mention the height and width attributes in layer-list as height and width attributes of item is supported only from API 23.
You can use below Drawable that worked below Android 4.0 and above 5.0.