2
下面的代碼工作正常,但只抓住在您的屏幕上可見的UIView。 我該如何獲取一個當前沒有顯示的UIView?捕獲非活動UIView作爲UIImage
謝謝!
//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"];
你是個天才!它被隱藏設置隱藏...非常感謝您的幫助。 :-) – jeddi
雖然與問題的標題不太相關......你知道是否可以向附件添加多於一個的圖像? – jeddi