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 shouldAutor开发者_Python百科otateToInterfaceOrientation 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?
Try putting a
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
After your declaration there. See if that works.
精彩评论