//---------- viewController.h file has
IBOutlet UIView *viewCamera; // custom view for taking camera reason
//------------viewController.m :: inside viewDidLoad method
// -- camera start
[viewCamera setBackgroundColor:[UIColor clearColor]];
imgPicker = [UIImagePickerController new];
imgPicker.allowsEditing = YES;
imgPicker.delegate = self;
imgPicker.cameraOverlayView = viewCamera;
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:imgPicker animated:NO completion:nil];
// ----- ob btn clicked
- (IBAction)btnTakePhotoPressed:(id)sender{
[imgPicker takePicture];
}
应用程序由于此行而崩溃,如果我评论此行代码正在运行但相机在完整视图中打开,我想在我的自定义视图中添加我的相机访问权限。
imgPicker.cameraOverlayView = viewCamera;
提前致谢:)