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;


  • 相关阅读:
    产品开发协作流程
    iOS性能优化
    iOS地图国内和国外的偏差
    Apple技术支持
    iOS应用架构谈 网络层设计方案
    form表单重复被提交
    SpringBoot+filter+listener+拦截器
    SpringBoot中的异常处理
    谷歌浏览器突然不能使用,并且出现报错码"STATUS_INVALID_IMAGE_HASH"解决方法
    form提交(图片,excel其他文件)
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看