UINavigationController 中的自动旋转
有一个 UINavigationController ,其中包含 rootViewController (作为根)和 secondViewController (作为子级)。 rootViewController 应该能够旋转到任何方向(按预期工作,我只是覆盖 shouldAutorotateToInterfaceOrientation),但是 secondViewController 应该在仅纵向模式(此处,我将 shouldAutorotateToInterfaceOrientation 设置为
interfaceOrientation == UIInterfaceOrientationPortrait
问题:从 rootViewController 导航到 secondViewController 后同时在横向中,secondViewController 不会将其 UI 切换回纵向是否有正确的方法?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
在您的声明之后添加一个。看看是否有效。
Try putting a
After your declaration there. See if that works.