我正在使用SDWebImage
库,图像大约 0.5 MB 并在detailView
单击时显示UITableViewCell
。
详细视图中的代码:
- (void)configureView
{
if (self.imageURL)
{
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload progress:^(NSUInteger receivedSize, long long expectedSize)
{
float percentDone = (float)receivedSize*200/(receivedSize+expectedSize);
[SVProgressHUD showWithStatus:[NSString stringWithFormat:@"Downloading... %0.0f%%", percentDone]];
if (percentDone == 100) {
[SVProgressHUD showSuccessWithStatus:@"Loaded."];
}
}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
{
}];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self configureView];
}
图像是否太大(半兆字节)?
SDWebImage
缓存这些图像。