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

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

概述在iOS 8下调用UIView的 [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES]; 导致1帧闪光的图像.您可以在屏幕上看到它一秒钟.只有当AfterScreenUpdates参数为YES时才会发生. 这是我完整的截图代码: UIGraphicsBeginImageContextWithOptions(self.bo 在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加上使用,这个问题消失了. 总结

以上是内存溢出为你收集整理的调用drawViewHierarchyInRect时如何防止闪存:afterScreenUpdates:在iOS 8?全部内容,希望文章能够帮你解决调用drawViewHierarchyInRect时如何防止闪存:afterScreenUpdates:在iOS 8?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1110669.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存