How to resolve the only ImagePicker control view in landscap mode and whole application in portrait mode?

Posted by Wolvorin on Stack Overflow See other posts from Stack Overflow or by Wolvorin
Published on 2012-12-11T11:02:32Z Indexed on 2012/12/11 11:03 UTC
Read the original article Hit count: 218

I have tried almost all the answers during last two days provided by Google and SO but no luck :(

What I want is my whole application is in portrait mode only.

And it working fine in ios 6+. The only support required at now.

But the problem is I need to launch UIImagePickerViewController with image source type camera in only landscap mode.

What I tried till now is :

(1) I try to create one category for UIImagePickerController for orientation.

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeLeft;
}

Like this. But the camera view is not proper aligned. It just follows the orientation of device with some +/- 90 angle but not what I required.

Even the button of the camera shown by camera view as camera control is also follows the camera view, ie. the view is rotated to 90 anti clock vise and stays to that way.

Is there any way to use the camera with proper alignment? or have to use other framework to work with it?

Please help me. I stuck with it for last two days.

© Stack Overflow or respective owner

Related posts about ios6

Related posts about uiimagepickercontroller