调用drawViewHierarchyInRect时如何防止闪存:afterScreenUpdates:在iOS 8?

在iOS 8下调用UIView的
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];

导致1帧闪光的图像.您可以在屏幕上看到它一秒钟.只有当AfterScreenUpdates参数为YES时才会发生.

这是我完整的截图代码:

UIGraphicsBeginImageContextWithOptions(self.bounds.size,NO,sf);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGContextConcatCTM(ctx,[self.layer affineTransform]);

if ([self respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { // iOS 7+
    [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
} else { // iOS 6
    [self.layer renderInContext:ctx];
}

UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

CGContextRestoreGState(ctx);
UIGraphicsEndImageContext();

有解决方法吗?

解决方法

提供@ 3x启动图像以在iPhone6和iPhone6加上使用,这个问题消失了.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...