Fresco图片框架初始化介绍
来源:互联网 发布:淘宝联盟返利靠谱吗 编辑:程序博客网 时间:2024/06/01 16:33
之前项目里面一直使用ImageLoder,现在想换个 图片加载框架,看到大家提到的最多的Fresco框架很好用, Fresco是facebook推出的一款强大的图片加载的框架。
1:由于我的开发工具是studio,所以需要在gradle中配置一下
compile 'com.facebook.fresco:fresco:0.10.0+'
2:同时需要在Application中初始化一下
Fresco.initialize(context);
3:加载网络图片时还需要有网络权限。
<uses-permission android:name="android.permission.INTERNET"/>
4:布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/image_view"
android:layout_width="300dp"
android:layout_height="300dp"
fresco:placeholderImage="@mipmap/ic_launcher"/>
</LinearLayout>
5:开始使用
SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.image_view);
Uri uri = Uri.parse("图片的网络地址");
imageView.setImageURI(uri);
- Fresco图片框架初始化介绍
- Fresco图片加载框架的简单介绍
- Fresco框架的介绍
- Fresco图片加载框架
- 图片加载框架-Fresco
- Fresco图片加载框架
- Fresco图片加载框架
- 图片框架Fresco
- Fresco图片框架详解
- Fresco图片加载框架
- FaceBook开源图片加载框架Fresco简单介绍
- Fresco第三方框架加载图片教程介绍
- android Fresco框架使用与介绍(图片加载组件)
- 图片加载框架之Fresco的使用介绍
- Fresco 图片加载框架用法
- Fresco图片加载框架使用
- 图片加载框架之Fresco
- 使用Fresco框架加载图片
- 1
- 写一个函数,求一个字符串的长度。
- fmt:formatDate格式化日期 各种类型 to Date
- 汤姆大叔深入理解JavaScript系列
- [Spring boot]配置文件properties加载
- Fresco图片框架初始化介绍
- 如何解决XML文件中的警告提示“No grammar constraints (DTD or XML Schema) referenced in the document.” .
- 浅析Java中的final关键字
- Linux中find详解
- [Perl] 内置常量$&, $`,$'这三个的用法
- 第三周项目1-顺序表的基本运算
- 耗时widget
- CISCO 零日漏洞 CVE-2016-6415,由NSA方程组泄露档案中探得
- vim 技巧备忘