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# 添加、删除、读取Word形状(基于Spire.Cloud.Word.SDK)
    Java 添加、修改、读取、复制、删除Excel批注
    Java 设置Word页边距、页面大小、页面方向、页面边框
    C# 将Word转为PDF、XPS、Epub、RTF(基于Spire.Cloud.Word.SDK)
    Java添加、读取Excel公式
    C# 添加文本、图片到PDF文档(基于Spire.Cloud.SDK for .NET)
    Java 在Excel单元格中应用一种/多种字体样式
    Java 添加、删除、移动、隐藏/显示Excel工作表
    Java 复制Excel工作表
    Java 将Excel转为图片、html、XPS、XML、CSV
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看