Ionic Cordova启动画面未隐藏在Android

时间:2017-11-11 01:27:01

标签: android cordova ionic-framework ionic2 cordova-plugins

我有一个简单的应用程序,可以在浏览器和iOS中正常工作,但由于某些原因,在Android设备和模拟器中,它们的应用程序停留在启动画面并且什么都不做。控制台日志中没有错误。但是,在铬检查的铬检查员中,我可以看到应用程序。已经查看了谷歌,无法找到任何有用的信息。

已删除并添加了启动画面插件。

我准备发布了,但只有这一个错误正在抓住我,我的时间不多了。请帮忙

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

在第一页上,您尝试启动应用程序put splashScreen.hide()以手动隐藏splashScreen。

ionViewDidEnter() {
    setTimeout(() => {
      if(this.platform.is('cordova')  || this.platform.is('android')){
      this.splashScreen.hide();
      }
    }, 300);

同时检查config.xml中的Splash屏幕属性,如下所示

<preference name="SplashScreenDelay" value="10000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="FadeSplashScreenDuration" value="1000" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="ShowSplashScreenSpinner" value="true" />

请参阅此link了解属性定义。

  
      
  1. SplashScreenDelay(数字,默认为3000)。在自动隐藏启动画面之前等待的时间(以毫秒为单位)。
  2.   
  3. “SplashShowOnlyFirstTime”首选项也是可选的,默认为true。设置为true时,闪屏仅显示在上面   申请发布。但是,如果您打算使用   navigator.app.exitApp()关闭应用程序并强制启动屏幕   在下次启动时出现,您应该将此属性设置为false(这   也适用于使用后退按钮关闭应用程序)。
  4.   
  5. FadeSplashScreenDuration(float,默认为500):指定要执行的启动画面淡入淡出效果的毫秒数。
  6.   
  7. FadeSplashScreen(布尔值,默认为true):设置为false以防止启动画面在显示时淡入淡出   状态变化。
  8.   
  9. ShowSplashScreenSpinner(boolean,默认为true):设置为false以隐藏启动画面微调器。
  10.