简体   繁体   English

Ionic Cordova启动画面未隐藏在Android中

[英]Ionic Cordova splash screen not hiding in Android

I have a simple application which works fine in browser and iOS, however for some reason in Android device and emulator they application stuck in the splash screen and do nothing. 我有一个简单的应用程序,可在浏览器和iOS上正常工作,但是由于某些原因,在Android设备和模拟器中,它们的应用程序停留在初始屏幕中,却无济于事。 No error in the console log. 控制台日志中没有错误。 however, in chrome inspector in chrome inspect I can see the application. 但是,在chrome inspector中,我可以看到该应用程序。 already looked into google and couldn't find any helpful information. 已经调查了谷歌,找不到任何有用的信息。

Already removed and added splash screen plugin. 已经删除并添加了初始屏幕插件。

I am ready to release the but only this one bug is holding me and I am running out of time. 我已经准备好发布该错误,但是只有一个错误阻止了我,我的时间已经用完了。 Please help 请帮忙

在此处输入图片说明

在此处输入图片说明

On the first page you try to launch the App put splashScreen.hide() to hide the splashScreen manually. 在第一页上,您尝试启动应用程序,将splashScreen.hide()手动隐藏起来。

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

Also check the config.xml for Splash screen properties like the below 还要检查config.xml中的启动画面属性,如下所示

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

Refer this link for property definitions. 请参阅此链接以获取属性定义。

  1. SplashScreenDelay (number, default to 3000). SplashScreenDelay(数字,默认为3000)。 Amount of time in milliseconds to wait before automatically hide splash screen. 自动隐藏启动画面之前需要等待的时间(以毫秒为单位)。
  2. "SplashShowOnlyFirstTime" preference is also optional and defaults to true. “ SplashShowOnlyFirstTime”首选项也是可选的,默认为true。 When set to true splash screen will only appear on application launch. 设置为true时,初始屏幕仅在应用程序启动时出现。 However, if you plan to use navigator.app.exitApp() to close application and force splash screen appear on next launch, you should set this property to false (this also applies to closing the App with Back button). 但是,如果您打算使用navigator.app.exitApp()关闭应用程序并在下次启动时强制显示启动画面,则应将此属性设置为false(这也适用于使用“后退”按钮关闭应用程序)。
  3. FadeSplashScreenDuration (float, defaults to 500): Specifies the number of milliseconds for the splash screen fade effect to execute. FadeSplashScreenDuration(浮动,默认为500):指定要执行的初始屏幕淡入淡出的毫秒数。
  4. FadeSplashScreen (boolean, defaults to true): Set to false to prevent the splash screen from fading in and out when its display state changes. FadeSplashScreen(布尔值,默认为true):设置为false以防止初始屏幕在其显示状态更改时淡入和淡出。
  5. ShowSplashScreenSpinner (boolean, defaults to true): Set to false to hide the splash-screen spinner. ShowSplashScreenSpinner(布尔值,默认为true):设置为false以隐藏初始屏幕微调器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM