Splashscreen不会出现在Ionic中

时间:2017-03-17 07:46:22

标签: ionic-framework splash-screen

执行ionic run android -lcs时,启动画面在我的应用上无法显示。

安装了splashscreen插件。我已成功运行ionic resources

使用黑色屏幕代替启动应用程序启动。

在控制台中键入navigator.splashscreen.show()并不起作用。

$ cordova --version
6.5.0
$ ionic --version
2.2.1

的Config.xml:

   <preference name="SplashScreen" value="splash"/>
   <preference name="AutoHideSplashScreen" value="false"/>
   <preference name="orientation" value="portrait"/>
   <preference name="SplashScreenDelay" value="10000"/>
   <preference name="FadeSplashScreenDuration" value="250"/>

<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-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>

<plugin name="cordova-plugin-splashscreen" spec="~4.0.2"/>

离子版:

$ ionic info

Your system information:

Cordova CLI: 6.5.0 
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.4.0
Xcode version: Not installed

1 个答案:

答案 0 :(得分:-1)

错误!

当我替换

<preference name="SplashScreen" value="splash"/>

通过

<preference name="SplashScreen" value="splash"/>
它似乎有用......