Android—shape画虚线

来源:互联网 发布:淘宝网首页女装春装 编辑:程序博客网 时间:2024/06/05 16:54

横线:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line" >
    <!-- 渐变色 -->
    <gradient
        android:centerX="5"
        android:endColor="#FFFFFF"
        android:startColor="#FFFFFF"
        android:type="sweep" />
    <stroke
        android:dashGap="3dp"
        android:dashWidth="5dp"
        android:width="1dip"
        android:color="#A6A6A6" />

</shape>


垂直:

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromDegrees="90"
    android:toDegrees="90" >


    <shape android:shape="line" >
        <stroke
            android:dashGap="3dp"
            android:dashWidth="5dp"
            android:color="#A6A6A6" />
    </shape>


</rotate>

0 0
原创粉丝点击