Tag: ios camera

iOS 7.1 imagePicker CameraFlashMode不指示Flash状态

我有iPhone应用程序覆盖相机与自定义视图。 我有一个button来切换相机闪光灯模式,这是代码 switch ([self.imagePickerController cameraFlashMode]) { case UIImagePickerControllerCameraFlashModeAuto: [self.imagePickerController setCameraFlashMode:UIImagePickerControllerCameraFlashModeOn]; return @"On"; break; case UIImagePickerControllerCameraFlashModeOn: [self.imagePickerController setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff]; return @"Off"; break; case UIImagePickerControllerCameraFlashModeOff: [self.imagePickerController setCameraFlashMode:UIImagePickerControllerCameraFlashModeAuto]; return @"Auto"; break; default: break; } 这是我的问题:在iOS 7.0x上工作得非常好,但在iOS 7.1中,cameraFlashMode属性返回UIImagePickerControllerCameraFlashModeAuto,无论其实际状态如何。 闪光模式确实改变,但我没有得到任何迹象。 任何线索? 谢谢

某些设备的设置下不会显示iOS相机权限

我在尝试使用相机时遇到了一些问题。 问题是有些设备在设置下向我显示“摄像机”条目,而另一些设备则不显示。 在那些没有出现相机开关的设备中,我无法使用相机,因为它没有权限,也不会在设置下出现。 这就是它在工作的设备上的外观: 这就是它在不起作用的设备中的外观。 当我把这些截图,应用程序应该已经要求权限,但它没有。 我还validation了这些设备没有启用限制。 有任何想法吗? 更新1:添加代码 这是我用来显示相机的代码(它在自定义视图下,而不是本机相机视图控制器) self.captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *videoCaptureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; NSError *error = nil; AVCaptureDeviceInput *videoInput = [AVCaptureDeviceInput deviceInputWithDevice:videoCaptureDevice error:&error]; if(videoInput) { [self.captureSession addInput:videoInput]; } else { NSLog(@"Error: %@", error); } AVCaptureMetadataOutput *metadataOutput = [[AVCaptureMetadataOutput alloc] init]; [self.captureSession addOutput:metadataOutput]; [metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; [metadataOutput setMetadataObjectTypes:@[AVMetadataObjectTypeCode39Code, AVMetadataObjectTypeQRCode]]; […]

从相机面部检测iOS

我收到一个图像视图 -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *mediaType = info[UIImagePickerControllerMediaType]; [self dismissViewControllerAnimated:YES completion:nil]; if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) { UIImage *image = info[UIImagePickerControllerOriginalImage]; //imgvprofileImage.image = image; //[self detectForFacesInUIImage:[UIImage imageNamed:@"image00.jpg"]]; [self detectForFacesInUIImage:image]; } else if ([mediaType isEqualToString:(NSString *)kUTTypeMovie]) { // Code here to support video if enabled } } 当我发送像这样的照片 [self detectForFacesInUIImage:[UIImage imageNamed:@"image00.jpg"]]; 检测效果很好,发现一张脸,但是当我使用从相机返回的图像时,它不起作用。 [self detectForFacesInUIImage:image] 这是我用来检测脸部的function […]