【问题标题】:Speedup IONIC 2 App Load Time or Splash Screen Delay For Android加速 IONIC 2 应用程序加载时间或 Android 启动画面延迟
【发布时间】:2017-04-20 09:34:43
【问题描述】:

我创建了一个 Ionic 2 应用程序,一切都很好。问题是当我在 IOS 中打开应用程序时,它会在按住启动画面 2/3 秒后快速加载,但是当涉及到 android 启动画面时,会在主屏幕出现前 7 到 10 秒显示。

我在加速方面搜索了很多,但没有找到完美的解决方案或解释。大多数答案说在 config.xml 中为 SplashScreenDelay 分配 3 秒的值,但它没有做任何更改。

如果有任何方法可以让它工作,请告诉我。

谢谢

【问题讨论】:

  • 使用 --prod 标志运行并检查应用加载时间是否有任何变化
  • 我已经尝试过调试、未签名和已签名的 apk,对所有人都是一样的......
  • 我的应用也遇到了同样的问题,我找不到任何原因导致 android 上的应用加载速度很慢
  • 只需检查您将页面设置为何时出现在 app.component 中。尝试在构造函数的开头设置页面(或者临时设置某些页面或模式),直到操作完成。然后设置所需的页面。我认为应用程序加载时会有一些您无法控制的延迟。最好使用闪屏。坦率地说,这也取决于手机的性能。我在低性能和高性能手机上都试过了。这很重要。这些会有 5-7 秒的差异。
  • 另外,使用<preference name="ShowSplashScreenSpinner" value="true" /> 可能是为了获得良好的外观,表明应用正在加载。

标签: android cordova ionic-framework ionic2 splash-screen


【解决方案1】:

您可以在知道应用准备就绪时手动关闭插件,而不是使用 SplashScreenDelay:

<preference name="AutoHideSplashScreen" value="false"/>

关于 config.xml

initializeApp() {

    this.platform.ready().then(() => {


        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        this.splashscreen.hide();

    });

}

在 app.component.ts 上

【讨论】:

  • 感谢您的回答,但刚刚与我的核对过,可以看到两者都已应用于我的 config.xml 和 app.comoponent.ts
猜你喜欢
  • 2019-02-21
  • 2023-03-22
  • 1970-01-01
  • 1970-01-01
  • 2017-12-09
  • 2011-10-25
  • 1970-01-01
  • 1970-01-01
  • 2012-03-24
相关资源
最近更新 更多