【发布时间】:2013-09-24 06:17:03
【问题描述】:
我只在 iOS 7 中收到此错误并且应用程序崩溃了。 在 iOS 6 中,我从来没有收到任何错误,只有一次打开相机时出现内存警告。
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
这就是我正在做的事情。
imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setAllowsEditing:YES];
[self presentModalViewController:imagePicker animated:YES];
我确实尝试过延迟presentModalViewController,但我仍然收到相同的消息。几秒钟后 (7-10),应用程序崩溃了。
此错误仅出现在 iOS 7 中。
有人知道吗?
【问题讨论】:
-
我也有同样的问题。在 iOS7 上 UIIMagePickerController 不再工作了。
-
调用这个方法对我有用。在呈现您的视图后放置它。 [yourViewBeingPresented.view layoutIfNeeded];
标签: ios iphone ios7 camera uiimagepickercontroller