iOSgif图播放
用SDWebImage可实现
1.网络路径下的gif图播放
引用头文件#import “UIImageView+WebCache.h”
UIImageView *imageView = [[UIImageView alloc] init];
imageView.frame = CGRectMake(10, 100, 300, 300);
NSString *urlStr = @“http://xxxx.com/sub_em_1001_1.gif”;
NSURL *url = [NSURL URLWithString:urlStr];
[imageView sd_setImageWithURL:url];
2.本地路径加载gif
#import “UIImage+GIF.h”
NSString *path = [[NSBundle mainBundle] pathForResource:@“xx” ofType:@“gif”];
NSData *imageData = [NSData dataWithContentsOfFile:path];
imageView.image = [UIImage sd_animatedGIFWithData:imageData];