Splashscreen耗时太长

时间:2017-02-20 10:08:26

标签: angular ionic2

如何在我的项目中降低启动时间?我尝试裁剪图像,但这似乎没有多大帮助。现在需要11秒.. 我将标准值更改为3000毫秒,没有帮助.. 这是一个ionic2 angular2应用程序。

1 个答案:

答案 0 :(得分:3)

在config.xml中添加

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

然后在你的app.component.ts中添加以下内容

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.
      StatusBar.styleDefault();
      Splashscreen.hide();
     }
}

这样,只有当您的应用准备好后,您的Splashscreen才会消失。这应该比10秒快得多

相关问题