1.添加依赖库
implementation ‘com.makeramen:roundedimageview:2.3.0’
2.在xml文件引用OK
- app:riv_border_color="#00000000"//设置边框颜色
- app:riv_border_width=“2dip”//设置边框宽度
- app:riv_corner_radius=“30dip”//设置角的弧度
<com.makeramen.roundedimageview.RoundedImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@mipmap/touxiangcopy"
app:riv_border_color="#00000000"
app:riv_corner_radius="100dp"
app:riv_border_width="2dip"/>