在ios 7中通过相机拍摄图像的自定义视图

时间:2014-07-05 07:31:44

标签: iphone ios7 ios-camera

    //---------- 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];
}

enter image description here

应用程序由于此行而崩溃,如果我评论此行代码正在运行但相机在完整视图中打开,我想在我的自定义视图中添加我的相机访问权限。

imgPicker.cameraOverlayView = viewCamera;

提前致谢:)

0 个答案:

没有答案