【发布时间】:2017-04-16 22:45:19
【问题描述】:
我正在使用PhoneGap 为iOS9+ 创建iOS 应用程序。根据指南,我在Config.xml 中添加了以下代码来设置启动画面。
// set the cordova plugin
<plugin name="cordova-plugin-splashscreen" source="npm" spec=">1.0.0" />
// set splash screen for iPad only
<platform name="ios">
<gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
<gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" />
<gap:splash gap:platform="ios" height="1536" src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />
</platform>
然后我在“终端”中使用以下命令生成 iOS 平台
phonegap build ios --device
它复制iOS平台中的所有启动图像。
但是当我启动应用程序时,它会显示默认的Phonegap 初始屏幕图像。我签入了 iOS 项目 'Images.xcassets'-> 'LaunchImage,它显示默认的 PhoneGap 图像。它没有显示我在 Config.xml 文件中提到的启动图像。如何使用config.xml 为iOS 设置启动图像?
【问题讨论】:
-
使用 ngCordova 插件显示或隐藏启动画面
$cordovaSplashscreen -
我已经检查了链接 cordova.apache.org/docs/en/latest/reference/… ,我尝试了两种方式,即文档中提到的“旧版启动图像”和“启动故事板图像”,但它仍然显示默认的 Phonegap 启动画面。
标签: ios cordova splash-screen phonegap-cli launchimage