什么时候,我从相机捕获图像,然后它在ios7的控制台上给出错误.我首先尝试没有在代码中添加Thread.sleep(3000),但这也无法正常工作.
完整错误:
快照未呈现的视图会导致空快照.确保在屏幕更新后快照或快照之前,您的视图至少呈现过一次.
码:
public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view,typically from a nib. PictureFromCameraButton.TouchUpInside += PictureFromCameraButton_Click; } private void PictureFromCameraButton_Click (object sender,EventArgs e) { try { Thread.Sleep (4000); ImagePickerController.SetSourceType(UIImagePickerControllerSourceType.Camera); this.PresentViewController (ImagePickerController,true,null); } catch (NotSupportedException exception) { //Logging Exception in Flurry FA.Flurry.LogError(exception.GetType().Name,exception.Message,new NSError(NSError.CocoaErrorDomain,3584)); BeginInvokeOnMainThread (() => { UIAlertView ErrorAlert = new UIAlertView ("Device unsupported","Your device does not support this feature",new UIAlertViewDelegate (),"OK"); ErrorAlert.Show (); }); } catch (Exception ex) { //Logging Exception in Flurry FA.Flurry.LogError(ex.GetType().Name,ex.Message,3584)); this.ShowErrorInProcessingAlertView (); } }