参考:

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;


 

相关文章:

  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案