Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于SDPhotoBrowserd加载gif问题 #61

Open
niuxinhuai opened this issue Dec 22, 2017 · 0 comments
Open

关于SDPhotoBrowserd加载gif问题 #61

niuxinhuai opened this issue Dec 22, 2017 · 0 comments

Comments

@niuxinhuai
Copy link

SDPhotoBrowserd在加载gif的时候会默认加载图片第一帧。满足不了项目需求。我这边做了一下小改进。大神有时间看下在SDImageView中- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder这里判断是否时gif
NSString * urlStr = [NSString stringWithFormat:@"%@",url];
在下载成功方法里判断gif
if ([urlStr hasSuffix:@".gif"]) {
dispatch_queue_t queue = dispatch_queue_create("testQueue", DISPATCH_QUEUE_CONCURRENT);
dispatch_async(queue, ^{
NSData * imageData = [NSData dataWithContentsOfURL:url];
dispatch_async(dispatch_get_main_queue(), ^{
_scrollImageView.image = [UIImage sd_animatedGIFWithData:imageData];
[_scrollImageView setNeedsDisplay];
return;
});

            });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant