Facebook图片加载框架Fresco【3 圆角图片】

在xml中设置如下属性,就可以把图片变为圆角

fresco:roundedCornerRadius="5dp"


Uri uri = Uri.parse("http://i.imgur.com/DvpvklR.png");
SimpleDraweeView imageView = (SimpleDraweeView) findViewById(R.id.image_view);
imageView.setImageURI(uri);```


![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1503465-55edac1cbd3c3d4d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 - 当然也可以设置底部不为圆角

fresco:roundBottomLeft="false"
fresco:roundBottomRight="false"
fresco:roundedCornerRadius="500dp"
fresco:actualImageScaleType="focusCrop"
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1503465-2007ed218a47745e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

- 如果你是用来做头像的,一般设置为圆圈图片

fresco:roundAsCircle="true"
fresco:actualImageScaleType="focusCrop"
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />



![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1503465-f8423688fa5d28f6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

- 还可以加个头盔

fresco:roundAsCircle="true"
fresco:actualImageScaleType="focusCrop"
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
fresco:roundingBorderWidth="10dp"
fresco:roundingBorderColor="#ff0000" />```

Facebook图片加载框架Fresco【3 圆角图片】_第1张图片
Paste_Image.png

你可能感兴趣的:(Facebook图片加载框架Fresco【3 圆角图片】)