【问题标题】:iOS native app build with phonegap opens in lower resolution使用 phonegap 构建的 iOS 本机应用程序以较低的分辨率打开
【发布时间】:2018-11-21 22:44:07
【问题描述】:

当我在 iPad Pro 12.9in 的浏览器中打开我的应用程序,同时使用桌面上的 PhoneGap 应用程序提供它时,它会按应有的方式打开。但是当我安装应用程序并打开它时,它以较低的分辨率打开。我发现这可能是因为启动画面分辨率较低,但我为 iPad pro 设计了一个分辨率为 2732x2048 的新启动画面。

我是否应该更改 config.xml 文件中的某些内容?我已经尝试了很多,但仍然没有找到解决方案。

These are the imported splash images for iOS with their resolutions

This is how the app looks when installed (1)

This is how the app looks when installed (2)

This is how the app should look - like it is now in the browser (1)

This is how the app should look - like it is now in the browser (2)

【问题讨论】:

    标签: javascript ios cordova native phonegap-build


    【解决方案1】:

    您是否已将新的 Splashscreen 添加到 config.xml 中?

    您需要该文件中的以下条目:

    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <splash src="<your path>/Default@2x~universal~anyany.png" />
        <splash src="<your path>/Default@2x~universal~comany.png" />
        <splash src="<your path>/Default@2x~universal~comcom.png" />
        <splash src="<your path>/Default@3x~universal~anyany.png" />
        <splash src="<your path>/Default@3x~universal~anycom.png" />
        <splash src="<your path>/Default@3x~universal~comany.png" />
    </platform>
    

    在我的例子中,路径是&lt;project&gt;/res/ios

    要使用这些,您至少需要 CLI 7.0.1 或 7.1.0 才能针对 iOS Phonegap 版本 4.4.0

    附加信息:

    【讨论】:

    • 好的,所以我调整了我的 config.xml 以使用故事板图像并且没有旧版启动图像,但现在徽标显示为启动图像。我正在使用 PhoneGap CLI 6.5.0 和 iOS Phonegap 版本 4.3.1。在我的 xml 文件中,我还导入了 cordova-plugin-splashscreen 版本 3.2.1:
    • 您能否通过针对 CLI 7.0.1 或 7.1.0 等更高版本来尝试一下?对我来说,它适用于 6.5.0,但我发现一篇文章提到这需要 4.4.0。您使用旧版本的闪屏插件有什么原因吗?最新版本是 5.0.2。看一看:medium.com/@photokandy/…
    • 谢谢!升级到 CLI 8.0.0 对我有用,但后来我遇到了一些构建错误。现在一切都已修复,可以正常工作。
    猜你喜欢
    • 1970-01-01
    • 2012-04-18
    • 2013-12-28
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    • 2019-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多