Android Studio 引入 Fresco
首选在build.gradle文件中配置

查看NDK路径


然后在gradle.properties文件中配置
ndk.path=C\:\\Users\\lixishuang\\AppData\\Local\\Android\\sdk\\android-ndk-r10c(参照上图)

在Android Studio 下面Terminal 中输入gradlew build回车 就可以等待了 看到成功后再操作
在AndroidManifest.xml文件中添加权限
<uses-permission android:name="android.permission.INTERNET"/>
在应用调用 setContentView()之前,进行初始化,一般在Application的onCreate()方法中进行
Fresco.initialize(context);
在xml布局文件中, 加入命名空间:
xmlns:fresco="http://schemas.android.com/apk/res-auto"
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/simple_drawee_view"
android:layout_width="20dp"(不能用wrap_content)
android:layout_height="20dp"(不能用wrap_content)
fresco:placeholderImage="@drawable/my_drawable" />
程序获取SimpleDraweeView
SimpleDraweeView imageView = (SimpleDraweeView) findViewById(R.id.simple_drawee_view);
赋值
imageView.setImageURI(Uri.parse("http://p4.so.qhimg.com/t0102672bd8a6bd290e.jpg"));
Android Studio 引入 Fresco的更多相关文章
- Android Studio导入Fresco
大概一周之前,Facebook开源了专为Android系统定制的图片下载缓存工具,当天该消息就上了各大技术论坛网站的头条,也成为了各个技术群里讨论的最主要的话题.也就在当天stay4it的QQ群里面就 ...
- android studio引入第三方包记录
1.添加jar文件 将jar文件复制至app module目录下的libs文件夹下,然后打开app module目录下的build.gradle配置文件,在dependencies项中添加配置命令,这 ...
- Android Studio 引入Lambda表达式
依次点击 [File][Other Settings][Default Project Structure]确保当前项目使用的JDK版本是1.8. 打开项目(Project)的build.gradle ...
- android studio 引入第三方类库jar包
第三方类库jar包 这就简单多了,直接将jar包拷贝到app/libs下,然后在app下的build.gradle中添加此jar的依赖.如下: dependencies { compile 'com. ...
- Android Studio 引入 Git 并提交代码
File -> Settings -> Version Control -> Git -> Path to Git executable -> 选择本地 Git 可执行文 ...
- Android Studio引入AAR文件
一.编译生成AAR文件 二.把AAR文件复制到项目的libs目录下 三.在项目的配置文件中加入如下代码: android { //other code repositories{ flatDir{ d ...
- Android Studio 引入 so 文件
1.在build.gradle中添加配置 task nativeLibsToJar(type: Zip, description: "create a jar archive of the ...
- android开发学习——android studio 引入第三方库的总结
http://www.jianshu.com/p/0c592fff5d89 总结的很溜
- Android Studio 1.0 (稳定版) 完全攻略
这篇博文中主要从以下几点进行叙述: 1.Android Studio安装与使用 2.Android Studio特性 3.Android Studio优点 Android Studio 安装与使用 A ...
随机推荐
- eclipse 使用(一)单步调试
昨天终于将取数据的流程走通了.但是没有成功获得数据.原因是,把服务器中的数据库还原到了本地.而测试数据是写到了本地.把数据给覆盖了.早上来了之后,赶紧在服务器上把数据弄了一下. 之后开始跑代码. 项目 ...
- Java开发常用Linux命令
1.查找文件 find / -name filename.txt根据名称查找/目录下的filename.txt文件. find . -name "*.xml"递归查找所有的xml文 ...
- C# 多线程的等待所有线程结束 用 ManualResetEvent 控制
using System; using System.Collections.Generic; using System.Threading; namespace ConsoleApplication ...
- iPhone SlideShow
If you found any question when you use the Slideshow, don't hesitate to leave a message please.
- Intellij Idea系列之Tomcat环境的搭建(三)
Intellij Idea系列之Tomcat环境的搭建(三) 一. 编写背景 Intellij Idea在刚上手的时候很多人吐槽,"god, 这么难用的IDE有谁用呀?",的确,I ...
- 随机数生成器console
#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { ]; ]; int i; ...
- 显示hello
The modern user interface is constructed from visual objects of various sorts. Depending on the oper ...
- yum install nginx
先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/pack ...
- VS2015 Android
最近安装了VS2015,体验了一下android 的开发,按模板创建运行了个,试下效果很不错.也可以可视化设计.但昨天再次打开或创建一个android程序后,设计界面直接不能显示,显示错误:(可能是升 ...
- Tomcat 常用配置
1.Tomcat 管理员设置 想要进入Tomcat管理界面: 打开Tomcat 目录 :进入 Conf目录,找到tomcat-users.xml文件,打开 修改 tomcat-users 节, 2.T ...