---
title: "UIImagePickerController in portrait mode inside UIPopoverController when view is locked for landscape mode"  
description: "UIImagePickerController in portrait mode inside UIPopoverController when view is locked for landscape mode"  
author: "Anonymous User"  
published: 2013-06-04  
updated: 2013-06-05  
canonical: https://www.mindstick.com/forum/982/uiimagepickercontroller-in-portrait-mode-inside-uipopovercontroller-when-view-is-locked-for-landscape-mode  
category: "iphone"  
tags: ["iphone"]  
reading_time: 1 minute  

---

# UIImagePickerController in portrait mode inside UIPopoverController when view is locked for landscape mode

Hi Mindstickians,\
I am using the following code for opening [camera](https://www.mindstick.com/forum/33574/enabling-camera-functionality-using-uiimagepickercontroller-class) inside [pop up](https://answers.mindstick.com/qa/50233/what-to-do-with-the-issues-that-may-pop-up-at-the-time-of-usb-device-installation) [view controller](https://www.mindstick.com/forum/33709/how-to-use-table-view-controller-with-small-sized-in-ios) in iPad. Everything is [working fine](https://answers.mindstick.com/qa/95550/why-is-the-safari-browser-not-working-fine) [except](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) it always open in [landscape mode](https://www.mindstick.com/forum/1597/printing-in-landscape-mode-vb-dot-net). I want to \
open pop camera in landscape mode. [Parent view](https://www.mindstick.com/forum/33462/how-to-pass-data-from-a-child-view-to-a-parent-view) is locked to landscape mode.Please let me know is it possible to change the camera [frame](https://www.mindstick.com/articles/749/html-frames) 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];
```

**\**Any help would be amazing thank you!\

## Replies

### Reply by AVADHESH PATEL

Hi Hugh,\
you can do this with Subclassing UIImagePickerController\

```
 @interface UAImagePickerController : UIImagePickerController {}@end@implementation UAImagePickerController- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {    return UIDeviceOrientationIsPortrait(toInterfaceOrientation);}@end
```

**\**It may be helpful for you.


---

Original Source: https://www.mindstick.com/forum/982/uiimagepickercontroller-in-portrait-mode-inside-uipopovercontroller-when-view-is-locked-for-landscape-mode

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
