【问题标题】:UIInterfaceOrientation in ios6.0ios6.0中的UIInterfaceOrientation
【发布时间】:2012-09-14 06:40:59
【问题描述】:

我正在开发 box2d 游戏。我的游戏 uiinterfaceOrientation 是 UIInterfaceOrientationLandscapeLeft,它在 ios5.1 中运行良好,但在 ios6.0 中我遇到了界面方向问题。我知道 – shouldAutorotateToInterfaceOrientation:在 iOS 6.0 中已弃用。对于 interfaceOrientation,他们给出的界面方向设置为 iPad 惯用语的 UIInterfaceOrientationMaskAll 和 iPhone 惯用语的 UIInterfaceOrientationMaskAllButUpsideDown。我不知道如何使用这个(UIInterfaceOrientationMaskAll)。我需要 UIInterfaceOrientationLandscapeLeft 中的游戏。怎么解决这个问题能告诉我.. 谢谢。。

【问题讨论】:

    标签: user-interface cocos2d-iphone box2d uiinterfaceorientation


    【解决方案1】:

    Here is a link to a blog about the new functions.

    根据您的需要,您需要添加的是:

    -(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscapeLeft;}
    

    这样就可以了,所以你只能横向运行。

    【讨论】:

      【解决方案2】:

      您还应该在 UISupportedInterfaceOrientations 中添加 UIInterfaceOrientationLandscapeLeft 并在 Info.plist 中添加 UIInterfaceOrientationproperty。您还可以通过从 shouldAutorotate 回调明确返回 false 来防止进一步的自动旋转。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-04-22
        • 2012-02-02
        相关资源
        最近更新 更多