一个SDWebImage插件,通过类别支持FLAnimatedImage https://github.com/SDWebImage/SDWebImageFLPlugin
从SDWebImage 5.0版本开始,我们将FLAnimatedImage支持代码从Core Repo移动到这个独立的repo。
之前使用带有SDWebImage的FLAnimatedImage的代码可以继续使用此插件。但建议使用5.0动画图像解决方案以获得更好的支持和更多功能。
pod 'SDWebImageFLPlugin'
使用
FLAnimatedImageView *animatedImageView = [[FLAnimatedImageView alloc] initWithFrame:self.view.frame];
animatedImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.view addSubview:animatedImageView];
[animatedImageView sd_setImageWithURL:[NSURL URLWithString:@"https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif"]];
FLAnimatedImageView *imageView;
FLAnimatedImage *animatedImage = [FLAnimatedImage animatedImageWithGIFData:gifData];
SDFLAnimatedImage *placeholder = [[SDFLAnimatedImage alloc] initWithAnimatedImage:animatedImage];
[imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.gif"] placeholderImage:placeholder];