0

Create a UIImagePickerController from code, adjust its properties, add an overlay onto it, but not open my camera view iPhone 5 in fullsrceen. my code is

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];
  • See this : http://stackoverflow.com/questions/20779628/how-to-get-the-custom-overlay-for-uiimagepicker-camera-to-be-full-screen-in-ios http://stackoverflow.com/questions/2674375/uiimagepickercontroller-doesnt-fill-screen might be helpful in your case. – Yasika Patel Aug 29 '14 at 06:37
  • Apply an appropriate scale transform. See [this link][1] for a code snippet . [1]: http://stackoverflow.com/a/15803947/2869784 – Nithin Michael Aug 29 '14 at 06:43

1 Answers1

0

Try this one. I have used this and it's work perfectly hope fully it'll work for you too.

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];
Tapas Pal
  • 7,073
  • 8
  • 39
  • 86