1

I am working on android application in which I want to use dotted line xml as a divider in my layout. For this I have used different drawables but instead to make a dashed dotted line, it is making a line. My image is given below

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
user5949689
  • 101
  • 2
  • 8
  • 1
    You can check [this](http://stackoverflow.com/questions/6103713/how-do-i-make-a-dotted-dashed-line-in-android) answer.It may help in your problem. – Khizar Hayat Feb 26 '16 at 07:46
  • 1
    This solved my question: http://stackoverflow.com/questions/18441081/create-a-horizontal-dotted-line-in-android-layout – user5949689 Feb 26 '16 at 08:54
  • Thanks for the dup link, will vote to close as a duplicate. – halfer Feb 26 '16 at 10:20

1 Answers1

3

in your ListView put

android:divider="@drawable/dash"

And in drawable folder create dash.xml and put following code

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line">
    <stroke
        android:color="#fdfdfd"
        android:width="1dp"
        android:dashGap="3dp"
        android:dashWidth="1dp"
        />
    <size
        android:height="3dp"
        />
</shape>

You can also change the color of dot

halfer
  • 19,824
  • 17
  • 99
  • 186
Bala Raja
  • 627
  • 6
  • 20