1

我的手机里有 3000 张图片。当我在手机中运行 MWPhotoBrowser 时。如果我刷得太快。它会崩溃的。

4

1 回答 1

0

在 MWGridViewController,cellForRow 中的代码。使用通知请求图像的原始方法。现在我通过使用块来改变它。它对我有用。

//my code
[photo requestImageForAsset:photo.asset size:CGSizeMake(cell.width * 2, cell.height * 2) resizeMode:PHImageRequestOptionsResizeModeFast completion:^(UIImage *image, NSDictionary *info) {
    if(image){
        photo.loadingInProgress = NO;
        cell.imageView.image = image;
        [cell hideLoadingIndicator];
        cell.selectedButton.hidden = !_selectionMode;
        [cell hideImageFailure];
    }
}];
//original code
UIImage *img = [_browser imageForPhoto:photo];
if (img) {
    [cell displayImage];
} else {
    [photo loadUnderlyingImageAndNotify];
}
于 2017-02-16T02:33:20.110 回答