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;


  • 相关阅读:
    bzoj 1217: [HNOI2003]消防局的设立
    [USACO09FEB]庙会班车Fair Shuttle
    bzoj 1052: [HAOI2007]覆盖问题
    bzoj 1974: [Sdoi2010]代码拍卖会
    bzoj 1835: [ZJOI2010]基站选址
    bzoj 1875: [SDOI2009]HH去散步
    bzoj 3295: [Cqoi2011]动态逆序对
    bzoj 2120: 数颜色
    P1032 字串变换
    简析拓扑排序
  • 原文地址:https://www.cnblogs.com/xuaninitial/p/6611628.html
Copyright © 2011-2022 走看看