【问题标题】:Orientation Landscape iOS 5 on xCode 4.6xCode 4.6 上的方向景观 iOS 5
【发布时间】:2013-05-01 16:19:51
【问题描述】:

我希望我的应用是横向的。我尝试了一切,我的故事板的方向是横向的,我在 info.plist 中更改了支持的方向和初始方向。谁能帮帮我?

在 iOS 6 模拟器中是横向的。

【问题讨论】:

    标签: iphone xcode ios5 ios6 orientation


    【解决方案1】:

    在 iOS 5 中,您需要在每个视图控制器中实现以下方法。

    // Called only in IO 5 and earlier.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
                interfaceOrientation == UIInterfaceOrientationLandscapeLeft );
    }
    

    并设置 UIInterfaceOrientation "初始界面方向 " 到 Info.plist 中的 UIInterfaceOrientationLandscapeRight

    并以横向模式布置您的视图。

    Apple's developer docs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多