iam*_*mer 13 iphone ipad ios ios8
在iOS 8下调用UIView的
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
Run Code Online (Sandbox Code Playgroud)
导致图像的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();
Run Code Online (Sandbox Code Playgroud)
有解决方法吗?
| 归档时间: |
|
| 查看次数: |
2294 次 |
| 最近记录: |