iOS8 Snapshotting a view that has not been rendered results in an empty snapshot

风格不统一 提交于 2019-12-04 12:44:40

I have had this error for a while too. I've contacted Xamarin Support, and they've told me that this is an error with iOS 8 and higher. There's no solution for this, other than waiting for some bugfix to roll out for iOS development or perhaps Xamarin itself. A workaround might be to set the build SDK to an earlier version and clean + rebuild your application.

Snapshotting a view that has not been rendered results in an empty snapshot same error.

This is definitely a bug and you can find this in apple developer forums as well.

I have tried to avoid this error using lot of other answers on stack overflow but could not fix this issue. However using this I could some how not get this error, i would not call this a fix, But give it a try and let me know if it had fixed the issue.
Dismiss the view controller using the Grand Central Dispatch async from the main queue fixed the issue for me.

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

// Code to handle the image data 

dispatch_async(dispatch_get_main_queue(), ^{
    [self dismissViewControllerAnimated:YES completion:nil];
});
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
dispatch_async(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];

});

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!