I want to draw horizontal and vertical dotted lines in android using shapes.
I want to draw like this
This solution is 100% working and wish help you:
At first create a drawable which will draw a horizontal dashed line.
Let dashed line drawable name is horizontal_dashed_line.xml
if you want to have vertical dashed line you have to rotate this drawable by followings:
Let drawable name is vertical_dashed_line.xml
Now you have a horizontal and vertical dashed line.
How to use:
To draw horizontal line simply add horizontal_dashed_line.xml in your layout. For example:
But if you want vertical line, just add vertical_dashed_line.xml instead of horizontal_dashed_line.xml.For example:
Good luck!