//width为线条的高度,dashWidth为破折线的宽度,dashGap为破折线之间的空隙的宽度,当dashGap=0时,就是实线 如果在<stroke>标签中设置了android:width,则在<View>标签中android:layout_height的值必须大于android:width的值,否则虚线不会显示。如果不设置,默认android:width为0。 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:width="1dp" android:color="@color/dialog_text_grey_color" android:dashGap="2dp" android:dashWidth="1dp" /> <size android:height="1dp"/> </shape>
虚线分割线
最新推荐文章于 2025-06-26 10:54:27 发布