Dotted line in android [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-08 08:59:40

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/35646118/dotted-line-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!