不能在iPhone 5中全屏打开我的自定义相机视图

时间:2014-08-29 06:27:50

标签: ios objective-c iphone ios7 ios6

从代码创建UIImagePickerController,调整其属性,在其上添加叠加, 但是没有打开我的相机在fullsrceen中查看iPhone 5。 我的代码是

self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;

self.picker.wantsFullScreenLayout = YES;

// Insert the overlay
self.overlay = [[OverlayViewController alloc] initWithNibName:@"Overlay" bundle:nil];
self.overlay.pickerReference = self.picker;
self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;

[self presentModalViewController:self.picker animated:NO];

1 个答案:

答案 0 :(得分:0)

试试这个。我已经使用了这个,它的工作完全希望它也适合你。

UIImagePickerController *imagePicker=[[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setAllowsEditing:YES];
[imagePicker setWantsFullScreenLayout:YES];
[self presentViewController:imagePicker animated:YES completion:^{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}];
[[UIApplication sharedApplication] setStatusBarHidden:YES];