【问题标题】:iPad Rotation lock problemiPad 旋转锁定问题
【发布时间】:2011-02-08 09:46:29
【问题描述】:

您好,我对 iPad 上的旋转有疑问,我已经搜索但没有找到正确的遮阳篷。

在 iPad 应用程序中,当我打开一个特殊的覆盖时,我可以旋转到所有界面方向,我会将界面方向锁定为横向,只要覆盖打开,应用程序就不应旋转。当我关闭此覆盖时,应启用旋转。

希望有人能帮帮我

【问题讨论】:

    标签: iphone xcode ipad ios rotation


    【解决方案1】:

    是的,您可以做到这一点。我没有测试过这段代码,但我认为它会起作用。

    - (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation     {
    // Return YES for supported orientations.
           if (showing_OVERLAY == YES) {
                return NO;
           }
      return YES;
    }
    

    【讨论】:

    • 谢谢,我在问她之前已经对此进行了测试,但是我已经在错误的 viewController(在 subViewController 中)中实现了这一点,我必须在 RootViewController 中执行此操作才能正常工作:-)
    • 这段代码到底去哪儿了?应用代理?观看次数?
    • 它位于您希望禁用旋转的类的 ViewController 中。例如- LoginViewController,如果您希望禁用旋转。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多