Ionic – Splash Screen适用于iOS,但不适用于Android

Ionic – Splash Screen适用于iOS,但不适用于Android,第1张

概述我有一个离子应用程序,其中使用CLI命令离子资源生成的启动画面和图标 iOS版本与正在渲染的启动画面完美配合,但在Android版本中,只有在加载应用程序时才会显示白屏. 我检查了config.xml文件,所有路径看起来都是正确的,生成的图像出现在相应的文件夹中. (我使用了splash.psd模板来生成它们. 我错过了什么? 这是config.xml文件供参考,我觉得我在这里做错了 – <?xm 我有一个离子应用程序,其中使用Cli命令离子资源生成的启动画面和图标

iOS版本与正在渲染的启动画面完美配合,但在Android版本中,只有在加载应用程序时才会显示白屏.

我检查了config.xml文件,所有路径看起来都是正确的,生成的图像出现在相应的文件夹中. (我使用了splash.psd模板来生成它们.

我错过了什么?

这是config.xml文件供参考,我觉得我在这里做错了 –

<?xml version="1.0" enCoding="UTF-8" standalone="yes"?><Widget ID="com.ionicframework.testeduser720691" version="0.0.1" xmlns="http://www.w3.org/ns/Widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">  <name>Tested Health</name>  <description>        An Ionic Framework and Cordova project.    </description>  <author email="you@example.com" href="http://example.com.com/">      Your name Here    </author>  <content src="index.HTML"/>  <access origin="*"/>  <preference name="webvIEwbounce" value="false"/>  <preference name="UIWebVIEwBounce" value="false"/>  <preference name="disallowOverscroll" value="true"/>  <preference name="androID-minSdkVersion" value="16"/>  <preference name="BackupWebStorage" value="none"/>  <preference name="SplashScreen" value="screen"/>  <preference name="SplashScreenDelay" value="3000"/>  <feature name="Statusbar">    <param name="ios-package" value="CDvstatusbar" onload="true"/>  </feature>  <platform name="androID">    <icon src="resources/androID/icon/drawable-ldpi-icon.png" density="ldpi"/>    <icon src="resources/androID/icon/drawable-mdpi-icon.png" density="mdpi"/>    <icon src="resources/androID/icon/drawable-hdpi-icon.png" density="hdpi"/>    <icon src="resources/androID/icon/drawable-xhdpi-icon.png" density="xhdpi"/>    <icon src="resources/androID/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>    <icon src="resources/androID/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>    <splash src="resources/androID/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>    <splash src="resources/androID/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>    <splash src="resources/androID/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>    <splash src="resources/androID/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>    <splash src="resources/androID/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>    <splash src="resources/androID/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>    <splash src="resources/androID/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>    <splash src="resources/androID/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>    <splash src="resources/androID/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>    <splash src="resources/androID/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>    <splash src="resources/androID/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>    <splash src="resources/androID/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>  </platform>  <platform name="ios">    <icon src="resources/ios/icon/icon.png" wIDth="57" height="57"/>    <icon src="resources/ios/icon/icon@2x.png" wIDth="114" height="114"/>    <icon src="resources/ios/icon/icon-40.png" wIDth="40" height="40"/>    <icon src="resources/ios/icon/icon-40@2x.png" wIDth="80" height="80"/>    <icon src="resources/ios/icon/icon-50.png" wIDth="50" height="50"/>    <icon src="resources/ios/icon/icon-50@2x.png" wIDth="100" height="100"/>    <icon src="resources/ios/icon/icon-60.png" wIDth="60" height="60"/>    <icon src="resources/ios/icon/icon-60@2x.png" wIDth="120" height="120"/>    <icon src="resources/ios/icon/icon-60@3x.png" wIDth="180" height="180"/>    <icon src="resources/ios/icon/icon-72.png" wIDth="72" height="72"/>    <icon src="resources/ios/icon/icon-72@2x.png" wIDth="144" height="144"/>    <icon src="resources/ios/icon/icon-76.png" wIDth="76" height="76"/>    <icon src="resources/ios/icon/icon-76@2x.png" wIDth="152" height="152"/>    <icon src="resources/ios/icon/icon-small.png" wIDth="29" height="29"/>    <icon src="resources/ios/icon/icon-small@2x.png" wIDth="58" height="58"/>    <icon src="resources/ios/icon/icon-small@3x.png" wIDth="87" height="87"/>    <splash src="resources/ios/splash/Default-568h@2x~iphone.png" wIDth="640" height="1136"/>    <splash src="resources/ios/splash/Default-667h.png" wIDth="750" height="1334"/>    <splash src="resources/ios/splash/Default-736h.png" wIDth="1242" height="2208"/>    <splash src="resources/ios/splash/Default-Landscape-736h.png" wIDth="2208" height="1242"/>    <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" wIDth="2048" height="1536"/>    <splash src="resources/ios/splash/Default-Landscape~ipad.png" wIDth="1024" height="768"/>    <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" wIDth="1536" height="2048"/>    <splash src="resources/ios/splash/Default-Portrait~ipad.png" wIDth="768" height="1024"/>    <splash src="resources/ios/splash/Default@2x~iphone.png" wIDth="640" height="960"/>    <splash src="resources/ios/splash/Default~iphone.png" wIDth="320" height="480"/>  </platform>  <icon src="resources/androID/icon/drawable-xhdpi-icon.png"/></Widget>
解决方法 在config.xml中添加以下键:
<feature name="SplashScreen"> <param name="androID-package" value="org.apache.cordova.splashscreen.SplashScreen" /></feature><preference name="ShowSplashScreen" value="true" /><preference name="SplashScreen" value="screen"/><preference name="SplashScreenDelay" value="3000"/><preference name="autoHIDeSplashScreen" value="true" /><preference name="SplashShowOnlyFirstTime" value="false" /><preference name="FadeSplashScreen" value="false"/>

它对我有用!

总结

以上是内存溢出为你收集整理的Ionic – Splash Screen适用于iOS,但不适用于Android全部内容,希望文章能够帮你解决Ionic – Splash Screen适用于iOS,但不适用于Android所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1100662.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存