Fresco是Facebook最新推出的一款用于Android应用中展示图片的强大图片库,可以从网络、本地存储和本地资源中加载图片。相对于ImageLoader,拥有更快的图片下载速度以及可以加载和显示gif图等诸多优势,是个很好的图片框架。PS:毕竟是facebook开源的,我说差也不会有人相信,还是夸夸吧!
github地址:https://github.com/facebook/fresco
首先体验其最基本的用法:
1.导入 Android Studio 或者 Gradle
dependencies {
compile 'com.facebook.fresco:fresco:0.9.0+'
}
2、在xml中引入SimpleDraweeView
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/image_view"
android:layout_width="20dp"
android:layout_height="20dp"
fresco:placeholderImage="@drawable/my_drawable"
/>
注意:1、在SimpleDraweeView的父控件或者根节点中配置
xmlns:fresco="http://schemas.android.com/apk/res-auto";
3、在Java代码中开始加载图片2、配置网络权限
Uri uri = Uri.parse("https://raw.githubusercontent.com/facebook/fresco/gh-pages/static/fresco-logo.png&#