UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
注:image就是截取的屏幕
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
注:image就是截取的屏幕