1
votes

I have an issue issue with the UINavigationController on the iPad. When the app is started in landscape orientation, popping the top view controller from the navigation controller causes the device orientation to turn into portrait and the view displayed slides down when the view that becomes visible and adjusts to portrait orientation. It makes no difference if I initiate the call or if it's done automatically by the back button.

When the app is started in portrait mode and device is turned into landscape later I don't see the same behavior and everything works fine.

Any pointers to where and what to look for to find the cause or workaround suggestions to prevent this from happening are welcome.

Thank you, Oz

1

1 Answers

2
votes

One of the view controllers in your UINavigationController's view hierarchy is not overriding the shouldAutorotateToInterfaceOrientation: method, which by default only returns YES for UIInterfaceOrientationPortrait – so, when that particular view controller comes to the front, it auto-rotates to an orientation it supports.

You can fix this by finding the offending view controller and adding the code below:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}