开发者

Autorotation in UINavigationController

开发者 https://www.devze.com 2023-01-13 08:16 出处:网络
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,

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消