Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Notifications You must be signed in to change notification settings

lixuegithub/DashView

Repository files navigation

DashView

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

##效果图

###水平虚线

img

###竖直虚线

img

#引入

dependencies {
 compile 'com.fang:dashview:v1.0.0'
}

##使用

 <com.fang.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:线段高度

##注意事项 当设定虚线的方向时,对应方向的wrap_content显示效果为match_parent,因为在实际情况中,虚线的尺寸总是固定的数值。

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /