Android

Android 使用RoundedImageView得不到圆形图

2019-07-17  本文已影响0人  Gao秋

贴上代码:

<com.makeramen.roundedimageview.RoundedImageView      android:id="@+id/iv_face" android:layout_width="70dp"  android:layout_height="70dp"                                 android:src="@drawable/test_picture"                                        app:riv_oval="true"/>

实现效果变成椭圆形

增加属性,android:scaleType="centerCrop"

变成圆形

这过程也就是说,要先通过scaleType来调整(裁剪)原图,然后再进行切圆角、加边框处理,这里用centerCrop才符合要求

附:compile 'com.makeramen:roundedimageview:2.3.0'

上一篇下一篇

猜你喜欢

热点阅读