Gallop icon indicating copy to clipboard operation
Gallop copied to clipboard

点击图片放大,然后缩小时,页面上的图片都没有了 (ios13)

Open jinshuaier opened this issue 4 years ago • 1 comments

jinshuaier avatar Dec 02 '19 06:12 jinshuaier

LWAsyncImageView.m 更改如下

  • (UIImage )image { UIImage image = nil;

    if (self.gifImage) { //如果是gif动画,这里从去当前帧的UIImage对象,当displayLink计时器触发时,会调用 //“- (void)displayLayer:(CALayer *)layer ”方法。通过设置Layer的contents完成动画的播放 image = self.gifCurrentFrame; } // else { // CGImageRef imageRef = (__bridge CGImageRef)(self.layer.contents); // image = [UIImage imageWithCGImage:imageRef]; // } return image; }

//- (void)setImage:(UIImage *)image { // //清除image // // if (!image) { // if (self.image) { // CGImageRef imageRef = (__bridge_retained CGImageRef)(self.layer.contents); // id contents = self.layer.contents; // self.layer.contents = nil; // if (imageRef) { // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ // [contents class]; // CFRelease(imageRef); // }); // } // } // // } else { // if (self.displayAsynchronously) { // [self.layer.lw_asyncTransaction addAsyncOperationWithTarget:self.layer // selector:@selector(setContents:) // object:(__bridge id _Nullable)image.CGImage // completion:nil]; // } // else { // [self.layer setContents:(__bridge id _Nullable)image.CGImage]; // } // } // // // //}

Jake-Chiu avatar Feb 14 '20 13:02 Jake-Chiu