美文网首页Android
Android 使用RoundedImageView得不到圆形图

Android 使用RoundedImageView得不到圆形图

作者: Gao秋 | 来源:发表于2019-07-17 17:56 被阅读0次

    贴上代码:

    <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'

    相关文章

      网友评论

        本文标题:Android 使用RoundedImageView得不到圆形图

        本文链接:https://www.haomeiwen.com/subject/lhzeeftx.html