现在很多界面都喜欢带个锯齿下边宽,如果没有其他好方法,可以试试我这种平铺方式实现。
1.首先需要切一个小三角的图片,背景透明,顶部和左右不能有间隙 ,(图片有点小,在这加个背景色突出)
2.在drawable写一个xml (关键代码标红)
<?xml version="1.0" encoding="utf-8"?>
<!--锯齿-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/list_refund"
android:tileMode="repeat">
</bitmap>
3.在需要锯齿的地方添加一个imageview背景为刚刚写的drawable。
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/repeatzigzag"
android:layout_below="@id/tv"
android:layout_marginTop="-1dp"
/>
运行效果如下图