【问题标题】:UIViewController View rotates when rotation is set to portrait onlyUIViewController 视图在旋转设置为仅纵向时旋转
【发布时间】:2013-09-19 01:36:02
【问题描述】:

我正在为 iOS 7 构建我的应用程序。在模态视图控制器上,我有以下用于用户界面方向的代码。

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotate
{
    return NO;
}

但是,当我旋转我的设备时,它会随着设备一起旋转!我应该补充一点,这个模态视图也嵌入在 UINavigationController 中。

感谢任何建议。

【问题讨论】:

    标签: iphone ios uiviewcontroller rotation ios7


    【解决方案1】:

    在 Apple Dev 论坛上找到此帖子。

    https://devforums.apple.com/message/861976#861976

    回答问题....如果嵌入在 UINavigationController 中,您必须子类化导航控制器以控制与您的应用设置中不同的设备旋转。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多