1
votes

In my universal application, I am creating a camera overlay view over my camera interface. Note that My app is locked for portrait mode. However, when I change the interface orientation of iPad, the overlay also rotates with it. But i don't want that!

How to stop it from rotating with rotation in interface?

this is how the overlay looks in portrait on iPAD (with home button down):

enter image description here

And this is how rotates in landscape on iPAD (with home button on left):

enter image description here

1

1 Answers

2
votes

Make sure you disable all but Portrait orientations in your app settings. enter image description here

EDIT

You can also create a custom UIImagePickerController class like this:

@interface MyImagePickerController : UIImagePickerController

@end

@implementation MyImagePickerController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return toInterfaceOrientation == UIInterfaceOrientationPortrait;
}

- (BOOL)shouldAutorotate
{
    return NO;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait;
}

@end