打赏

Android实现水平虚线和竖直虚线

水平虚线

shape:   line-horizontal.xml 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:width="1dp"
android:color="#747474"
android:dashWidth="6dp"
android:dashGap="3dp" />
</shape>

 


竖直虚线
shape:   line-vertical.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-600dp"
android:right="-600dp">
<rotate android:drawable="@drawable/line_horizontal"
android:visible="true"
android:fromDegrees="90"/>
</item>
</layer-list>

 

posted @ 2021-03-09 11:31  张学涛  阅读(1486)  评论(0编辑  收藏  举报