<?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="#c4c4c4"
android:dashGap="3dp"
android:dashWidth="6dp" />
<!-- 虚线的高度 -->
<size android:height="1dp" />
</shape>
关于4.0以上设备虚线会变实线的问题, 以下2种方式解决
line.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
android:layerType="software"