您的位置:首页 > 移动开发 > Android开发

Android画虚线

2016-03-01 16:37 405 查看

<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="line">
<!--显示一条虚线,破折线的宽度为dashWith,破折线之间的空隙的宽度为dashGap,当dashGap=0dp时,为实线 -->
<stroke
android:width="1dp"
android:color="@color/cl_font_gray"
android:dashGap="3dp"
android:dashWidth="6dp" />
<!-- 虚线的高度 -->
<size android:height="2dp" />

注意4.0以上使用该shape只会显示直线不会显示虚线,此时需要在使用的时候添加属性android:layerType="software"

</shape>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: