使用自定义相机覆盖视图时底部的黑色视图(UIImagePickerController)

时间:2013-11-29 09:56:25

标签: ios objective-c xcode ios6 xcode5

我想使用自定义相机叠加视图。下面是它的代码。

imagePicker = [[UIImagePickerController alloc] init];
self.imagePicker.delegate = self;
self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imagePicker.showsCameraControls = NO;
self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
self.imagePicker.toolbarHidden = YES;
self.imagePicker.wantsFullScreenLayout = YES;
self.imagePicker.navigationBarHidden = YES;
self.imagePicker.cameraOverlayView = [self cameraOverlayView];

问题是底部有黑色背景,我不知道它来自哪里。 代码有什么问题?

1 个答案:

答案 0 :(得分:3)

尝试使用cameraViewTransform进行全屏显示。

    CGFloat camScaleup = 2;
    imagePicker.cameraViewTransform = CGAffineTransformScale(imagePicker.cameraViewTransform, camScaleup, camScaleup);