Landscape Apps Xcode 5/iOS 7

Teo*_*rig 2 xcode landscape objective-c ios ios7

我在App Store里有一个钢琴应用程序.它适用于横向模式.

在此输入图像描述

现在iOS 7似乎忽略了IB中的Landscape设置

在此输入图像描述

该应用程序在iOS 6及更低版本中可以正常运行.在iOS 7中出现在肖像中.以下是设置和相关代码:

在此输入图像描述 在此输入图像描述

//iOS 6+
- (BOOL)shouldAutorotate
{
    return YES;
}

//iOS 6+
- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight);
}
//iOS 5.1.1-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Run Code Online (Sandbox Code Playgroud)

Teo*_*rig 6

感谢@shawnwall评论,我意识到我没有Root View Controller.在过去我的应用程序给予支持iOS 3.1.3 O_O:

[self.window addSubview:self.viewController.view];
Run Code Online (Sandbox Code Playgroud)

我很久以前就放弃了3.1.3支持,所以我可以设置一个根视图控制器:

self.window.rootViewController = self.viewController;
Run Code Online (Sandbox Code Playgroud)

这就是导致视觉错误的原因.