Reference:
Http://www.jianshu.com/p/f0530a75c7af
A loaded chrysanthemum with a horse egg does not turn
Found
// nsstring *path = [[NSBundle mainbundle] pathforresource:@ "spin" oftype:@ "GIF"]; // NSData *data = [NSData Datawithcontentsoffile:path]; // UIImage *image = [UIImage sd_animatedgifwithdata:data]; // cell.loadingimg.image=image;
This can't be used. It is important to:
The image returned by the Sd_animatedgifwithdata method of the SD contains only the first frame.
Find a new way
Use Flanimatedimageview.
#import <FLAnimatedImage/FLAnimatedImageView.h>
#import <FLAnimatedImage/FLAnimatedImage.h>
nsstring *path = [[nsbundle mainbundle] pathforresource:@ "spin" OfType :@ "GIF"];
nsdata *data = [nsdata datawithcontentsoffile:p ath];
flanimatedimage *image = [flanimatedimage animatedimagewithgifdata:d ATA];
Flanimatedimageview *imageview = [Flanimatedimageview new];
ImageView. Animatedimage = image;
iOS loading GIF pictures