解除自定义navigationController后,iPhone强制方向更改为纵向模式

时间:2015-05-05 19:31:34

标签: ios iphone ios7 ios8

我有一个navigationController作为rootViewController,它只是Portrait,在工作流程中我将自定义navigationController呈现为横向模式中的模态。所有这一切都有效,但是当我在横向模式中关闭提供的navigationController时,演示者/父视图将以横向显示。这仅在设备旋转时发生,我已经检查了Plist和其他位置(故事板中的VC方向标志),其中它仅设置为纵向。

提供的ViewController Modally有一个自定义的NavigationController,我将覆盖-shouldAutorotate:返回NO,-supportedInterfaceOrientations:返回UIInterfaceOrientationMaskLandscapeLeft和-preferredInterfaceOrientationForPresentation:返回UIInterfaceOrientationLandscapeLeft。

需要VC布局:

  1. RootViewController - 仅限肖像
  2. presentViewController - Landscape
  3. RootViewController - 纵向,当解除Landscape VC时。
  4. 我已尝试过堆栈溢出中陈述的许多方法:

    1. 为NavigationController创建设置为rootViewController的类别 并指定方向为肖像 -supportedInterfaceOrientations:和-preferredInterfaceOrientationForPresentation:。
    2. [UIApplication setStatusBarOrientation:animated:]
    3. 在解雇完成处理程序中设置方向。
    4. 但似乎没有工作,任何想法或帮助?

0 个答案:

没有答案
相关问题