【问题标题】:Cannot hide default cordova-splash screen ionic 3无法隐藏默认的cordova-splash screen ionic 3
【发布时间】:2019-08-20 16:13:22
【问题描述】:

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

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

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

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

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

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

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

joshmorony

coursetro

但他们都没有工作。

【问题讨论】:

    标签: ionic3 splash-screen


    【解决方案1】:

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

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

    【讨论】:

    • 如你所见,我在上面的 splash.ts 文件中已经完成了
    猜你喜欢
    • 2021-10-03
    • 1970-01-01
    • 2020-05-26
    • 2015-05-06
    • 2020-06-06
    • 2021-02-23
    • 2018-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多