iOS7 后的屏幕截图方式

- (UIImage *)snapshot:(UIView *)view

{

UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0);

[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];

UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return image;

}

官方文档 https://developer.apple.com/library/ios/qa/qa1817/_index.html

你可能感兴趣的:(iOS7 后的屏幕截图方式)