iOS:我的故事板是横向的,项目设置为横向,但在模拟器中仍然错误

iOS:我的故事板是横向的,项目设置为横向,但在模拟器中仍然错误,ios,ipad,Ios,Ipad,我想做一个iPad应用程序。 我做了以下三件事。模拟器方向为横向,这是正确的。然而,内容是90度错误,但他们在情节提要视图中是正确的,景观。有什么我需要检查的吗 我将我的故事板设置为风景 我可以设置“支持的界面方向”=景观吗 在视图控制器中也使用了此代码: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation==U

我想做一个iPad应用程序。 我做了以下三件事。模拟器方向为横向,这是正确的。然而,内容是90度错误,但他们在情节提要视图中是正确的,景观。有什么我需要检查的吗

  • 我将我的故事板设置为风景

  • 我可以设置“支持的界面方向”=景观吗

  • 在视图控制器中也使用了此代码:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
        return YES;
    else
        return NO;
    }
    

  • 确保在Info.plist中也设置了“初始界面方向”。

    支持的界面方向是一回事。直到我做了以下工作,它才对我起作用:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
    }
    

    您必须在所有ViewController上使用以下代码

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
            return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
    }
    

    谢谢,我做了,但还是不工作。我用同样的步骤重新创建了一个新项目,然后它就开始工作了@我有完全相同的问题-让我发疯!!