【问题标题】:Can't create iPad XIB with Xcode 6无法使用 Xcode 6 创建 iPad XIB
【发布时间】:2015-08-02 22:02:23
【问题描述】:

好的,我手上有问题。我正在尝试将我的项目转换为适用于 iPhone 和 iPad 的通用应用程序。我正在尝试制作我的 XIB 文件的 iPad 特定版本。由于无法在 Xcode 5 中使用自动调整掩码创建 iPad 版本。当我为 ipad 创建单独的 xib 时,我的应用程序崩溃了,比如 ViewController~ipad.xib 而我的 Iphone ViewController 是 ViewController.xib。

【问题讨论】:

    标签: ipad xib


    【解决方案1】:

    您需要通过 ViewController 将特定的 XIB 加载到内存中。 iphone 特定文件没有该代码。我已经在 C# 中这样做了

    static bool UserInterfaceIdiomIsPhone {
                get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
            }
    
            public LoginController ()
                : base (UserInterfaceIdiomIsPhone ? "LoginController_iPhone" : "LoginController_iPad", null)
            {
            }
    

    您可能必须将其转换为 Objective C 或 swift..但这就是想法..这必须在每个控制器中完成

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-20
      • 2011-07-17
      • 1970-01-01
      • 2015-09-30
      • 1970-01-01
      • 2011-09-10
      • 2016-08-05
      相关资源
      最近更新 更多