UIView *cutView = self.view.window.rootViewController.view;
//截图
//开启上下文
UIGraphicsBeginImageContextWithOptions(cutView.frame.size, YES, 0.0);
//把cutView渲染到上下文中
[cutView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
//取出image
//_imageView.image =
//结束上下文
UIGraphicsEndImageContext();
转载于:https://my.oschina.net/u/865478/blog/317586