从代码创建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];
答案 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];