首页 > 解决方案 > 无法隐藏默认的cordova-splash screen ionic 3

问题描述

我为我的 ionic 应用程序制作了一个自定义启动屏幕页面。问题是当我为 ios 平台构建项目时,默认启动画面仍在加载。

我在 config.xml 文件中添加了以下内容:

  <preference name="ShowSplashScreen" value="false" />
  <preference name="SplashScreenDelay" value="0" />

同样在自定义启动画面的 ionViewDidEnter() 中,我隐藏了默认的科尔多瓦启动画面;

 ionViewDidEnter() {
   this.splashScreen.hide();
   ......
 }

可能是什么问题?每次我在 xcode 中运行构建项目时,都会首先出现 Cordova 初始屏幕(应该隐藏),而不是自定义的。

我已经尝试了以下参考中的配置设置:

约什莫罗尼

课程

但他们都没有工作。

标签: ionic3splash-screen

解决方案


您是否为 splashScreen 安装了本机插件?如果没有,请按照以下步骤操作: ionic cordova plugin add cordova-plugin-splashscreen npm install --save @ionic-native/splash-screen@4

导入后: import { SplashScreen } from '@ionic-native/splash-screen'; constructor(private splashScreen: SplashScreen) { } 你可以使用this.splashScreen.hide();


推荐阅读