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;


  • 相关阅读:
    Android Studio 如何导入源码
    多版本 jdk 的切换方法
    Markdown的常用语法
    adb常用命令
    虚拟机怎样共享ubuntu中的文件
    adb的相关配置
    【Leetcode】2的幂(整数的二进制形式,与运算)
    【Leetcode】二叉树的最小深度
    【Leetcode】合并两个有序链表
    【Leetcode】国王挖金矿
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看