用Facebook开源框架Frescok加载网络图片的简单使用


Fresco中文说明:http://www.fresco-cn.org/

Fresco项目GitHub地址:https://github.com/facebook/fresco

第一步:进入 Fresco项目GitHub地址

第二步:引入到Android Studio项目中



第三步:服务及权限:



第四步:Xml代码

1、加入命名空间:

2、加入SimpleDraweeView



第五步 初始化默认设置



第六步 加载网络图片




总结:

XML属性 意义
fadeDuration 淡入淡出动画持续时间(单位:毫秒ms)
actualImageScaleType 实际图像的缩放类型
placeholderImage 占位图
placeholderImageScaleType 占位图的缩放类型
progressBarImage 进度图
progressBarImageScaleType 进度图的缩放类型
progressBarAutoRotateInterval 进度图自动旋转间隔时间(单位:毫秒ms)
failureImage 失败图
failureImageScaleType 失败图的缩放类型
retryImage 重试图
retryImageScaleType 重试图的缩放类型
backgroundImage 背景图
overlayImage 叠加图
pressedStateOverlayImage 按压状态下所显示的叠加图
roundAsCircle 设置为圆形图
roundedCornerRadius 圆角半径
roundTopLeft 左上角是否为圆角
roundTopRight 右上角是否为圆角
roundBottomLeft 左下角是否为圆角
roundBottomRight 右下角是否为圆角
roundingBorderWidth 圆形或者圆角图边框的宽度
roundingBorderColor 圆形或者圆角图边框的颜色
roundWithOverlayColor 圆形或者圆角图底下的叠加颜色(只能设置颜色)
viewAspectRatio
控件纵横比





猜你喜欢

转载自blog.csdn.net/pshiping2014/article/details/49868383