Ios8 在iOS 8中,在modally presented view controller上显示UIImagePickerController无法正常工作

Ios8 在iOS 8中,在modally presented view controller上显示UIImagePickerController无法正常工作,ios8,uiimagepickercontroller,uimodalpresentationstyle,Ios8,Uiimagepickercontroller,Uimodalpresentationstyle,我已经从modally presented view controller中演示了UIImagePickerController。单击图像后,我得到一个黑色图像,而不是单击的图片 我做了这样的事 //From ViewController1 I presented view controller2 with - (IBAction)buttontappedToPresentViewController2:(id)sender { ViewController2* controller2

我已经从modally presented view controller中演示了UIImagePickerController。单击图像后,我得到一个黑色图像,而不是单击的图片 我做了这样的事

//From ViewController1 I presented view controller2 with 
- (IBAction)buttontappedToPresentViewController2:(id)sender
{
    ViewController2* controller2 = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
    controller2.modalPresentationStyle = UIModalPresentationPageSheet;
    [self controller2 animated:YES completion:nil];
}


//In ViewController2, I presented the UIIMagePickerController
- (IBAction)cameraButtonTapped:(id)sender
{
    UIImagePickerController *cameraController = [[UIImagePickerController alloc] init];
    cameraController.mediaTypes = @[(NSString *)kUTTypeImage,(NSString*)kUTTypeMovie];
    cameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:cameraController animated:YES completion:NULL];
}
单击图像后,您将获得黑屏,而不是使用“重拍”和“使用照片”选项拍摄的图像。如果您选择“使用照片”选项,您将在回调中获得正确的图像

注意:如果未为viewController2设置UIModalPresentationStyle,代码工作正常

知道这里出了什么问题吗


编辑:我使用了XCODE 5.1,我的目标部署是iOS 7。我正在iOS8设备上运行应用程序。

我也遇到了同样的问题/。。没有答案?真可惜!我使用XCODE 6构建我的项目,并在UIImagePickerController上使用modalPresentationStyle作为UIModalPresentationOverFullScreen来解决此问题。解决方法:我创建了一个新的UIWindow,并添加了一个blankViewController作为其根视图控制器,并使用该视图控制器在iOS7中全屏显示UIImagePickerController。