zoukankan      html  css  js  c++  java
  • 引入Fresco

    这里告诉你如何在项目中引入 Fresco.

    使用 Android Studio 或者其他 Gradle 构建的项目

    编辑 build.gradle 文件:

    1
    2
    3
    4
    dependencies {
      // 其他依赖
      compile 'com.facebook.fresco:fresco:0.12.0'
    }
    

    下面的依赖需要根据需求添加:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    dependencies {
      // 在 API < 14 上的机器支持 WebP 时,需要添加
      compile 'com.facebook.fresco:animated-base-support:0.12.0'
    
      // 支持 GIF 动图,需要添加
      compile 'com.facebook.fresco:animated-gif:0.12.0'
    
      // 支持 WebP (静态图+动图),需要添加
      compile 'com.facebook.fresco:animated-webp:0.12.0'
      compile 'com.facebook.fresco:webpsupport:0.12.0'
    
      // 仅支持 WebP 静态图,需要添加
      compile 'com.facebook.fresco:webpsupport:0.12.0'
    }
    

    Eclipse ADT

    下载 zip 文件.

    解压后,你会看到一个目录:frescolib,注意这个目录。

    1. 从菜单 “文件(File)”,选择导入(Import)
    2. 展开 Android, 选择 “Existing Android Code into Workspace”, 下一步。
    3. 浏览,选中刚才解压的的文件中的 frescolib 目录。
    4. 这5个项目应该被添加到工程: drawee, fbcore, fresco, imagepipeline, imagepipeline-base。请确认这5个项目一定是被选中的。点击完成。其他的项目参考之前 Gradle的额外依赖介绍。
    5. 右键,项目,选择属性,然后选择 Android。
    6. 点击右下角的 Add 按钮,选择 fresco,点击 OK,再点击 OK。

    现在,fresco 就导入到项目中了,你可以开始编译了。如果编译不通过,可以尝试清理资源,或者重启 Eclipse。

    如果你想在网络层使用 OkHttp,请看这里.

    如果 support-v4 包重复了,删掉 frescolib/imagepipeline/libs 下的即可。

    详细官方文档:https://www.fresco-cn.org/docs/index.html

    建议尽早使用 Android Studio。

  • 相关阅读:
    树莓派Raspberry命令行配置无线网络连接
    Gradient Descent
    下载知乎指定问题的答案并保存图片
    获取JQuery UI tabs中被选中的tabs的方法
    VM603:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
    PHPstorm配置远程及本地服务器
    ubuntu系统搭建samba服务
    centos6.4升级openssh7.4p1
    nginx服务学习第二章
    centos7.2升级openssh7.9p1
  • 原文地址:https://www.cnblogs.com/huolongluo/p/6094799.html
Copyright © 2011-2022 走看看