-
(UIImage *)snapshot:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();return image;
}
还有UIView 的 [-snapshotViewAfterScreenUpdates:] and [-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:] 也能截图
UIScreen的[-snapshotViewAfterScreenUpdates:]方法