weex使用SDWebImage4.0不能显示动图
本文介绍了weex使用SDWebImage4.0不能显示动图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
- (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock {
return (id<WXImageOperationProtocol>)[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if (completedBlock) {
completedBlock(image, error, finished);
}
}];
}
sd4.0的下载图片api和weex手册中示例不一样,有碰到相同问题的吗?
解决方案
自己解决了
附上解决办法:工程里用了两个版本的SDWebImage,3.7.5专门用来下载weex中的图片。因为两个库中会有符号重复冲突,所以我对类名做了自动混淆。
这篇关于weex使用SDWebImage4.0不能显示动图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文