简体   繁体   English

Cordova 闪屏插件 - 升级到 iOS 14 后,在闪屏出现之前快速显示黑屏

[英]Cordova splashscreen plugin - After upgrading to iOS 14 a black screen is quickly shown before splash screen appears

I am using cordova-plugin-splashscreen 6.0.0我正在使用cordova-plugin-splashscreen 6.0.0

It appears that the plugin is not working how it used to be on previous iOS versions.该插件似乎无法在以前的 iOS 版本上正常工作。 After upgrading to iOS 14, a black screen is shown very quickly before the real splash screen image is shown.升级到 iOS 14 后,在显示真正的启动画面图像之前,很快就会显示黑屏。

I am using only the Default 2x universal image in my config.xml:我在 config.xml 中只使用默认的 2x 通用图像:

Additional splash screen configurations are:其他启动画面配置是:

<preference name="SuppressesLongPressGesture" value="true" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="5000"/>
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="true" />

Any ideas?有任何想法吗?

Something changed in the way splash screens are handled in iOS 14:在 iOS 14 中处理启动画面的方式发生了一些变化:

The entry <splash src="res/screen/ios/Default@2x~universal~anyany.jpg" /> is no longer being used for iPhones.条目<splash src="res/screen/ios/Default@2x~universal~anyany.jpg" />不再用于 iPhone。

Now we have to add this entry: <splash src="res/screen/ios/Default@2x~iphone~anyany.jpg" /> in order to get iPhone devices covered too.现在我们必须添加这个条目: <splash src="res/screen/ios/Default@2x~iphone~anyany.jpg" />为了让 iPhone 设备也被覆盖。

For people using only the universal~anyany entry (the only entry necessary in previous iOS versions): you just have to add the iphone~anyany entry to your config.xml file and you are good to go.对于只使用Universal~anyany条目(在以前的 iOS 版本中唯一需要的条目)的人:您只需将iphone~anyany条目添加到您的config.xml文件中,您就可以开始使用了。

See example below:请参阅下面的示例:

<splash src="<path to your image>/Default@2x~universal~anyany.jpg" />

<splash src="<path to your image>/Default@2x~iphone~anyany.jpg" />

Obviously you also have to create another image file called Default@2xiphoneanyany.jpg (or png) with the resolution 1334 x 1334 pixels and put it inside your splash screen images directory.显然,您还必须创建另一个分辨率为 1334 x 1334 像素的名为Default@2xiphoneanyany.jpg (或 png)的图像文件,并将其放入启动画面图像目录中。

Another thing that I noticed is that the splash screen fading effect is no longer working if the FadeSplashScreenDuration entry is not stated in the config.xml file.我注意到的另一件事是,如果config.xml文件中未说明 FadeSplashScreenDuration条目,则闪屏淡入淡出效果将不再起作用。

So, you just have to add this line to your config.xml file and you will get the same default fading effect as in the previous iOS versions:因此,您只需将此行添加到您的config.xml文件中,您将获得与以前的 iOS 版本相同的默认淡入淡出效果:

<preference name="FadeSplashScreenDuration" value="500"/>

I'm seeing the same thing.我看到了同样的事情。 Also only using default 2x universal if that may have anything to do with it.如果这可能与它有任何关系,也只使用默认的 2x 通用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM