Android 虚线

布局:

<TextView
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:layout_centerHorizontal="true"
        android:background="@drawable/line_stroke"
        android:layerType="software" />

line_stroke的代码:

<?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="@color/color_d8"
        android:dashWidth="6dp"
        android:dashGap="4dp" />
</shape>
发布了38 篇原创文章 · 获赞 11 · 访问量 8787

猜你喜欢

转载自blog.csdn.net/u013750244/article/details/102929121
今日推荐