相机在ios 8中显示黑屏 [英] Camera show black screen in ios 8

查看:118
本文介绍了相机在ios 8中显示黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码用于从相机中逐个捕获图像,但在下次拍摄一张图像后,相机将打开但黑屏(如同,快门关闭)。所有其他ios版本的工作,但不适用于ios 8 。请告诉我如何解决?

This code for capturing image one by one from camera,but after taking one image next time camera will open but with black screen(like it,s shutter close).all other ios version its working,but not working in ios 8.please tell me how can i solve it?

-(void)openCamera
 {
   if(![PickerHandler doesDeviceSupportMediaType:ITEM_TYPE_PHOTO])
   {
    [PickerHandler showNoDeviceSupportWarningForMediaType:ITEM_TYPE_PHOTO withDelegate:self];
   }
   else 
   {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;

    picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
    [self presentViewController:picker animated:YES completion:nil];
   }

 }


推荐答案

转到设置>隐私权>图片 ...并检查您的应用是否有权限。

Go to Settings > Privacy > Pictures ... and check if your app have permission.

在代码中,使用此功能验证相机访问。

In the code, use this to verify camera access.

- (BOOL)authorizedCameraAccess
{
    AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
    return  (status == AVAuthorizationStatusAuthorized);
}

这篇关于相机在ios 8中显示黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆