[安卓开发Android][圆角圆形头像] roundedimageview简单应用

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"/>

效果:

[安卓开发Android][圆角圆形头像] roundedimageview简单应用_第1张图片

你可能感兴趣的:(Android)