我正在使用这段代码来捕获iPad屏幕。我一直收到“self.view.layer”的错误消息
UIGraphicsBeginImageContextWithOptions(window.bounds.size, window.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
答案 0 :(得分:0)
首先在项目中添加QuartzCore框架并添加
#import< QuartzCore / QuartzCore.h>