【问题标题】:Device-specific orientation for universal app通用应用程序的设备特定方向
【发布时间】:2012-12-12 09:17:58
【问题描述】:

我有一个通用应用程序。我希望我的应用可以在 iPhone 的两种方向模式下工作,但仅适用于 iPad 的纵向模式,

如何做到这一点?

setOrientationtion 在 iOS5 中没有响应。

【问题讨论】:

    标签: iphone ios ipad uiinterfaceorientation


    【解决方案1】:
    1. 转到目标窗口。
    2. 单击“摘要”选项卡。
    3. iPhone/iPad 部署 info -> 为 iPhone 和 iPad 设置支持的界面方向 根据您的要求。无需执行即可解决您的问题 单行代码。

    【讨论】:

      【解决方案2】:

      这将对您有所帮助:

      if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        // The device is an iPad running iPhone 3.2 or later.
        // Rotate to landscape
      }
      else {
        // The device is an iPhone or iPod touch.
        // Rotate to portrait
      }
      

      【讨论】:

        【解决方案3】:

        您可以在 Xcode 的项目设置编辑器中为每个设备设置方向。

        【讨论】:

          【解决方案4】:

          试试 ios5 及之前的 shouldAutorotateToInterfaceOrientation: 方法。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2019-03-29
            • 2020-08-26
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多