iOS 7 - UIImagePickerController中的黑色预览屏幕

时间:2014-01-23 06:54:28

标签: ios7 uiimagepickercontroller

使用以下代码启动图像选择器以捕获图像。
任何人都可以帮忙解决这个问题......

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {        

    if (self.camera)
    {
        self.camera = nil;
    }

    self.camera = [[UIImagePickerController alloc] init];
    self.camera.sourceType =  UIImagePickerControllerSourceTypeCamera;
    self.camera.allowsEditing = NO;
    self.camera.delegate = self;

    [self presentViewController:self.camera animated:YES completion:NULL];


}

1 个答案:

答案 0 :(得分:0)

如果您在后台有任何GCD,则在启动UIImagePickerController之前可能是导致此问题的原因。我的代码在启动UIImagePickerController之前有GCD,现在删除了GCD,它运行正常。