zoukankan      html  css  js  c++  java
  • iOS加载Gif图片

    参考:

    http://www.jianshu.com/p/f0530a75c7af
    
    
     https://github.com/Flipboard/FLAnimatedImage 

      

    马蛋的一个加载的菊花不转了 

    发现

       // NSString *path = [[NSBundle mainBundle] pathForResource:@"spin" ofType:@"gif"];
      //  NSData *data = [NSData dataWithContentsOfFile:path];
       // UIImage *image = [UIImage sd_animatedGIFWithData:data];
    
      //  cell.loadingImg.image=image;

    这个不能用了  重要的是 :

    sd的sd_animatedGIFWithData方法返回的image只包含第一帧。

    找了新方法

    使用FLAnimatedImageView。

    
    

    #import <FLAnimatedImage/FLAnimatedImageView.h>

    
    

    #import <FLAnimatedImage/FLAnimatedImage.h>



     NSString *path = [[NSBundle mainBundle] pathForResource:@"spin" ofType:@"gif"];

        NSData *data = [NSData dataWithContentsOfFile:path];

        FLAnimatedImage *image = [FLAnimatedImage animatedImageWithGIFData:data];

       

       FLAnimatedImageView *imageView = [FLAnimatedImageView new];

       

        imageView.animatedImage = image;


  • 相关阅读:
    挂断电话——黑名单拦截
    上传文件 服务端模拟存储
    短信监听+短信拦截
    c#常用控件缩写(装)
    20121016学习笔记四
    c#日期时间格式化
    FTP服务器配置以及访问
    关于远程桌面设置和连接
    20121016学习笔记三
    电脑开机应用程序自动启动设置
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看