以下のコードはうまく機能しますが、画面に表示されるUIViewのみを取得します。現在表示されていないUIViewを代わりに取得するにはどうすればよいですか?
ありがとう!
//Take a screenshot of the view...
UIGraphicsBeginImageContext(View_1.frame.size);
[View_1.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *View_1 = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(View_1, nil, nil, nil);
//...and attach it as an image to the email
NSData *myData3 = UIImagePNGRepresentation(View_1);
[picker addAttachmentData:myData3 mimeType:@"image/png" fileName:@"screenshot2"];