Thanks to visit codestin.com
Credit goes to github.com

Skip to content

一个在Android上实现绘制虚线的控件,可以指定虚线的样式和方向

Notifications You must be signed in to change notification settings

lixuegithub/DashView

Repository files navigation

DashView

###一个在Android上实现绘制虚线的控件,可以指定虚线的样式以及方向

##效果图

###水平虚线

img

###竖直虚线

img

##使用

 <com.thomas.dashview.DashView
        android:layout_marginLeft="40dp"
        android:layout_width="wrap_content"
        android:layout_height="300dp"
        app:dashWidth="2dp"
        app:lineWidth="4dp"
        app:lineColor="@android:color/holo_green_light"
        app:dashOrientation="1"
        app:lineHeight="1dp"
        />

###属性介绍

dashWidth:两段线段之间的间距
lineWidth:每条线段宽度
lineColor:线段颜色
dashOrientation:虚线方向 0水平1竖直
lineHeight:线段高度

##注意事项 当设定虚线的方向后,对应方向的属性的模式就要设置为EXACTLY,例如当前为水平虚线,那么控件的layout_width属性就必须为match_parent或者固定数值

About

一个在Android上实现绘制虚线的控件,可以指定虚线的样式和方向

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%