SDWebImage4.0之前

     UIImageView *imgView = [UIImageView new];
imgView.contentMode = UIViewContentModeScaleAspectFit;
imgView.frame = CGRectMake(, , , ); NSString *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]]pathForResource:@"going" ofType:@"gif"];
NSData *imageData = [NSData dataWithContentsOfFile:filePath];
imgView.backgroundColor = [UIColor clearColor];
imgView.image = [UIImage sd_animatedGIFWithData:imageData];
[self addSubview:imgView];

SDWebImage4.0之后

     FLAnimatedImageView *imgView = [FLAnimatedImageView new];
imgView.contentMode = UIViewContentModeScaleAspectFit;
imgView.frame = CGRectMake(, , , );
NSString *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]]pathForResource:@"going" ofType:@"gif"];
NSData *imageData = [NSData dataWithContentsOfFile:filePath];
imgView.backgroundColor = [UIColor clearColor];
imgView.animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
[self addSubview:imgView];

SDWebImage4.0之后加载gif不显示的解决方案的更多相关文章

  1. [ActionScript 3.0] AS3.0 动态加载显示内容

    可以将下列任何外部显示资源加载到 ActionScript 3.0 应用程序中: 在 ActionScript 3.0 中创作的 SWF 文件 — 此文件可以是 Sprite.MovieClip 或扩 ...

  2. ie6,7下js动态加载图片不显示错误

    ie6,7下js动态加载图片不显示错误 先描述一下出现这种匪夷所思bug的背景: 我在页面加载的时候加载一堆小缩略图,<a href="javascript:void(0);" ...

  3. 在页面未加载完之前显示loading动画

    在页面未加载完之前显示loading动画 这里有很多比这篇博客还优秀的loading动画源码 我还参考这篇博客 loading动画代码demo 我的demo预览 <!DOCTYPE html&g ...

  4. Fullcalendar改版后发布到IIS或者tomcat里面前端加载数据不显示的问题

    问题如题:Fullcalendar改版后发布到IIS或者tomcat里面前端加载数据不显示的问题 解决办法:通过火狐浏览器工具发现是时间格式不对的原因,需要将时间格式修改为:yyyy-MM--DD   ...

  5. vue项目未加载完成前显示loading...

    1.在Index.html里面加入loading的元素,让loading元素显示,让app元素隐藏 <!DOCTYPE html> <html> <head> &l ...

  6. IE8中jQuery.load()加载页面不显示的原因

    一.jQuery.load() jQuery.load(url,[data],[callback])通过Ajax异步请求加载服务器中的数据,并把数据放到指定元素中. url :请求服务器的地址 dat ...

  7. C#连接Sqlite 出现:混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。的解决方案

    C#连接Sqlite 出现: 混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集.的解决方案 C#连接sqlite数据库代码 ...

  8. Thinkphp5.0怎么加载css和js

    Thinkphp5.0怎么加载css和js 问题 http://localhost/手册上的那个{load href="/static/css/style.css" /} 读取不到 ...

  9. mybatis plus3.1.0 热加载mapper

    今天又开始写业务代码了,每次修改SQL都要重启服务,实在是浪费时间. 想起之前研究过的<mybatis plus3.1.0 热加载mapper>,一直没有成功,今天静下心来分析了问题,终于 ...

随机推荐

  1. CSS类的操作

    CSS类的操作 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <t ...

  2. wx-一个简单页面

    一个具有顶部,底部和中间的html页面,但没有js <view class="root"> <!-- 标签栏的页签 固定高度 --> <view cl ...

  3. maven的下载、安装及配置

    一.下载maven 1. maven的下载路径 (1)Apache官网:https://maven.apache.org (2)https://pan.baidu.com/s/1Yvv44ICGSxG ...

  4. Appium(七):Appium API(一) 应用操作

    1. 应用操作 本章所罗列的方法主要针对应用的操作,如应用的安装.卸载.关闭.启动等. 把前面的启动代码放在这里,后面只展示不同的部分. # coding:utf-8 from appium impo ...

  5. hadoop集群搭建教程

    1. 相关软件准备: VMware-workstation-full-15.0.4-12990004.exe CentOS-7-x86_64-DVD-1810.iso jdk-8u231-linux- ...

  6. js的cookies及html5的localStorage、sessionStorage

    1.首先,理解什么是cookies? cookies:存储在客户端,数据量小的,会过期的数据,以字符串形式存储 cookie操作代码示例: <script> window.onload = ...

  7. Fabric-Ca使用

    Fabric-Ca的概念不再解释了,这里只说明使用方法: 前置条件 Go语言1.10+版本 GOPATH环境变量正确设置 已安装libtool和libtdhl-dev包 Ubuntu系统 通过以下命令 ...

  8. Selenium环境要配置浏览器驱动

    1.浏览器环境变量添加到path 2.将浏览器相应的驱动.exe复制到浏览器目录 3.这条就是让我傻逼似的配置一上午的罪魁祸首:将驱动.exe复制到python目录!!!! Selenium

  9. ES6- Class类的使用,声明,继承

    声明一个类 //class 类 class Coder{ // 类中都是方法 函数 //val是name方法的参数 name(val){ console.log(val) //类 return val ...

  10. oracle截取时间的年/月/日/时/分/秒

    修改日期格式为年月日时分秒: alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';select to_char(sysdate,'yyy ...