一個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];