Cordova - 视网膜显示器上的缩放比例不正确

Cordova - incorrect scaling on retina displays

我刚刚创建了一个新的 Cordova 项目。我使用 cordova build 进行项目,然后使用 xcode 在我的设备上启动。一切正常,直到我在 iPad Pro 12.9 视网膜显示器上启动应用程序。在这里,应用程序似乎缩放不正确,如下图所示(请注意,即使状态栏也缩放不正确):

https://i.stack.imgur.com/ZhLAp.jpg:

不过,我确实有办法解决 "resolving" 这个问题:如果我打开 xcode 并将 "Launch Screen File"(在应用程序图标和启动图像下)更改为 MainViewController.xib,它似乎解决了这个问题,如下图所示。 但是 (!) 当启动应用程序时,用户会看到不需要的黑屏。

https://i.stack.imgur.com/W7rAX.jpg:

所以我的问题是:有没有办法解决原来的问题,而不影响启动屏幕?我非常想要一个不涉及进入 xcode 和手动更改某些内容的解决方案。

注:

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">

因此,显然 Apple 正在放弃启动屏幕图像以支持启动故事板,iPad Pro 12.9 是第一个不再像其他设备那样支持启动屏幕图像的候选者。来自 Cordova documentation:

Apple is moving away from legacy launch images. There is no official support for providing a native-resolution launch image for the iPad Pro 12.9 or for providing launch images that work with split-screen multitasking or slide-over. If your app doesn't need to support these contexts, then you can continue to use legacy launch images for as long as you like

但是,幸运的是 Cordova 4.5.1(及更高版本)支持启动屏幕故事板,如 here.

所述

为了使用故事板,我首先创建了一个2048x2048 image,将其命名为Default@3x~universal~anyany.png并放在res/screen/ios/中。然后我将以下内容添加到我的 config.xml:

<platform name="ios">
  ···
  <splash src="res/screen/ios/Default@3x~universal~anyany.png" />
  ···
</platform>