0

I am using the following code for opening camera inside pop up view controller in iPad. Everything is working fine except it always open in landscape mode. I want to open pop camera in landscape mode. Parent view is locked to landscape mode.
Please let me know is it possible to change the camera frame size to portrait mode.

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
imagePicker.delegate = self;
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
self.popOverController = popover;
popover.popoverContentSize = CGSizeMake(350, 500);
popover.delegate = self;
[self.popOverController presentPopoverFromRect:CGRectMake(100, 100, 350,500) inView:self permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76

1 Answers1

0

you can do this with Subclassing UIImagePickerController

 @interface UAImagePickerController : UIImagePickerController {
}
@end

@implementation UAImagePickerController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return UIDeviceOrientationIsPortrait(toInterfaceOrientation);
}
@end
Sunny Shah
  • 12,990
  • 9
  • 50
  • 86