Search code examples
androidxmlpaintstroke

Dotted line separator with custom thickness


I have a dotted line separator

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">

    <!-- 
#17b851 #C7B299
     -->
    <stroke
       android:color="#9e9c85"
       android:dashWidth="10px"
       android:dashGap="10px" 
       />
</shape>

Right now its barely visible. How can I make it thick . I tried giving android:height="2px" & android:dashHeight="5px" but it didnt work.


Solution

  • You can use stroke width,

    android:width="3dp"
    

    snapshot

    enter image description here