Frescoj说明:
-------------------------------------------Fresco引入包及依赖项↓↓↓↓↓----------------------------------------------
检查添加mavenCentral();
-------------------------------------------Fresco引入包及依赖项↑↑↑↑↑----------------------------------------------
-------------------------------------------Fresco使用↓↓↓↓↓----------------------------------------------
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/my_image_view"
android:layout_width="130dp"
android:layout_height="130dp"
fresco:placeholderImage="@mipmap/ic_launcher"
fresco:roundedCornerRadius="5dp"
/>
</LinearLayout>
Uri uri=Uri.parse("http://b.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=6585d7a9820a19d8cb568c0106caaebd/faf2b2119313b07e63bade100ed7912397dd8ca7.jpg");
SimpleDraweeView draweeView= (SimpleDraweeView) findViewById(R.id.my_image_view);
DraweeController mDraweeController = Fresco.newDraweeControllerBuilder()
.setAutoPlayAnimations(true)
//设置uri,加载本地的gif资源
.setUri(uri)//设置uri
.build();
//设置Controller
draweeView.setController(mDraweeController);
}
-------------------------------------------Fresco使用↑↑↑↑↑----------------------------------------------
参考网站:https://www.fresco-cn.org/docs/getting-started.html