【发布时间】:2018-06-09 19:32:17
【问题描述】:
我创建了一个 html、javascript 游戏,并使用 cordova 和 Xcode 将其部署到我的 iphone,问题是当我启动我的应用程序并完成加载时,启动图像在显示我的游戏之前淡出到白屏.我认为这是一种默认行为。我研究了如何防止它消失,这就是我发现的:iOS 7 launch image (splash screen) fades out
但是答案似乎已经过时了,因为我没有一个名为 AppController 的文件,而且它需要一些我没有学过的 Objective-C 知识。
请帮帮我...我只是想摆脱瞬间褪色到白屏的问题。
-编辑-
我意识到在 iOS 中,启动画面图像被称为启动图像,但我决定安装启动画面插件并再次测试我的应用程序,现在启动画面/启动图像的行为有点不同,而不是淡入白屏,它会立即淡入我的游戏,但我不想要淡入淡出效果,所以我像这样编辑了 config.xml 文件,但它仍然会淡出。
这是我的 config.xml 文件的一部分
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
<splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
<splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/>
<splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
<splash src="res/screen/ios/Default-Landscape-736h.png" width="2208" height="1242"/>
</platform>
<engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
<preference name="FadeSplashScreen" value="false"/>
【问题讨论】:
-
你在使用闪屏插件吗?如果是这样,请分享您的 config.xml
-
嗨,我已经更新了我的问题,请查看:)
标签: javascript ios xcode cordova