cocoapriest
cocoapriest

Reputation: 1859

Autorotation in UINavigationController

There're an UINavigationController with rootViewController (as root) and secondViewController (as a child). The rootViewController should be able to rotate to any orientation (that works as expected, I just override the shouldAutorotateToInterfaceOrientation), but the secondViewController should work in Portrait mode only (here, I set the shouldAutorotateToInterfaceOrientation to

interfaceOrientation == UIInterfaceOrientationPortrait

The issue: after navigating to the secondViewController from the rootViewController while in landscape, the secondViewController doesn't switch its UI back to portrait. Is there a right way to do so?

Upvotes: 2

Views: 451

Answers (1)

Matt Meyers
Matt Meyers

Reputation: 11

Try putting a

[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];  

After your declaration there. See if that works.

Upvotes: 1

Related Questions