首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Splashscreen耗时太长

Splashscreen耗时太长
EN

Stack Overflow用户
提问于 2017-02-20 18:08:26
回答 1查看 199关注 0票数 1

我怎样才能在我的项目中得到闪屏?我试着裁剪图像,但似乎没有太大帮助。现在需要11秒..我将标准值更改为3000ms,没有帮助..这是一款ionic2 angular2应用程序。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-20 18:10:33

在您的config.xml中添加

代码语言:javascript
复制
<preference name="AutoHideSplashScreen" value="false"/>

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

代码语言:javascript
复制
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();
     }
}

这样,你的闪屏只会在你的应用程序准备好的时候消失。这应该比10秒快得多

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42341645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档