UIInterfaceOrientaion not following app rules

Go To StackoverFlow.com

0

I've been having a huge problem with this. Xcode just simply turned my landscape mode app into a portrait view and It doesn't go back !

I've programmed the entire app almost to run in landscape mode in the Ipad.

On the Storyboard, every window is in lanscape. I believe i did the settings correctly according to the images below

enter image description here

enter image description here

and finally on my viewController I have:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}

Anybody know what could be going wrong or why would Xcode just set the screen to portrait out of nowhere while I was just adjusting a viewController?

2012-04-05 01:55
by Farini


1

If you want to only support landscape then change shouldAutorotateToInterfaceOrientation to:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
        interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        return YES;
    }
    // Default
    return NO;
}
2012-04-05 02:53
by lnafziger
still showing portrait mode. Both on portrait and landscape - Farini 2012-04-05 04:16
Yeah. I copied and pasted the code on all view controllers now it works. Thanks - Farini 2012-04-05 04:20
Ads