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;


  • 相关阅读:
    SQL中 SET QUOTED_IDENTIFIER OFF语句的作用
    System.Data.SQLite
    关于SQL Server的SET ANSI_NULLS的问题
    压缩解压缩下载多个文件
    提示源文件路径不存在
    Jquery颜色选择器
    MVC中使用DropDownListFor
    jquery ajax 跨域请求
    纪念帖:博客开张,发帖留念!
    解压缩:解压之后中文文件名乱码
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看