0
我有一個UIImagePickerController,我添加了一些包含圖像的子視圖。我需要將整個內容保存爲圖像,但是無法做到這一點。iphone保存多個視圖截圖
爲了節省我使用下面的代碼上下文的內容
UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
它的工作原理爲的UIImagePickerController,但如果我添加子視圖停靠在
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
線,沒有任何控制檯中的錯誤,只是退出應用程序。
謝謝!