I want to make dashed line using shape
.
This is my XML:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="line">
<stroke android:color="@color/grey_divider"
android:width="1dip"
android:dashWidth="5dip"
android:dashGap="13dip"/>
</shape>
</item>
</selector>
On my device I see this: But I need something like this:
How to fix it?
Try this
Make one xml file in drawable.(e.g. dashed_line.xml)
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#C7B299"
android:dashWidth="10px"
android:dashGap="10px"
android:width="1dp"/>
</shape>
And now use this xml file in your layout.
android:background="@drawable/dashed_line"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With