【问题标题】:Force iPad Pro to full resolution without Launch Screen在没有启动屏幕的情况下强制 iPad Pro 达到全分辨率
【发布时间】:2015-11-22 21:25:06
【问题描述】:

我想在我的 iOS 应用中使用启动图像,而不是启动屏幕。 (启动图像可以比启动屏幕更精确地定位设备;there's no way to make a launch screen that behaves exactly like a launch image.

如果您的 iOS 应用程序中没有启动屏幕,iPad Pro 会呈现屏幕分辨率为 1024x768 点宽的情况。 (要看到这个,创建一个新项目,删除它的启动屏幕,然后在 iPod Pro 模拟器中启动它。)

有没有办法让 iPad Pro 在不使用启动屏幕的情况下以原生 1366x1024 点进行渲染?

【问题讨论】:

    标签: ios xcode ipad


    【解决方案1】:

    不,您必须使用启动屏幕来支持 iPad Pro。这就是 Apple 决定支持它的方式。

    如果您找不到使用单个启动屏幕来获得所需结果的方法,您可以提供一个特定于 iPhone 和一个特定于 iPad。

    更新:Xcode 8 支持 iPad Pro Launch 图像插槽,因此您不再必须使用 Launch 屏幕文件来支持 iPad Pro。

    【讨论】:

    • 如何提供单独的启动屏幕?
    • @joelg 当然可以。我正在我的一个应用程序中这样做。
    • @joelg 是的。如果您对另一个问题有疑问,请在此处发布您的 cmets 或添加您自己的问题,而不是与这个问题和答案相悖。
    【解决方案2】:

    现在可以在不使用启动屏幕的情况下支持 iPad 12.9 和 iPad 10.5。

    我相信 Xcode 8 在 xcassets 文件中曾短暂支持 iPad Pro,但该支持已被撤销。

    但是,info.plist 文件中添加了一个密钥,允许使用静态图像。

    人机界面指南: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/

    Apple 技术文档: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW28

    示例代码(添加到 info.plist)

    <key>UILaunchImages</key>
    <array>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn480</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{320, 480}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn568</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{320, 568}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn667</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{375, 667}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn736</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{414, 736}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn1024</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{768, 1024}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn1112</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{834, 1112}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
        <dict>
            <key>UILaunchImageName</key>
            <string>Burn1366</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{1024, 1366}</string>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
        </dict>
    </array>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-17
      • 1970-01-01
      • 1970-01-01
      • 2022-12-12
      相关资源
      最近更新 更多