ionic3 - 无法隐藏默认的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 初始屏幕(应该隐藏),而不是自定义的。
我已经尝试了以下参考中的配置设置:
但他们都没有工作。
解决方案
您是否为 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();
推荐阅读
- docker - Docker 清漆错误 503 后端提取失败
- php - 在 WooCommerce 电子邮件通知的订单详细信息表中隐藏自定义费用行
- mysql - 临时转换列数据类型以对临时列数据类型运行新查询 - MySQL
- excel - 如何从共享工作簿、Excel VBA 中限制/禁用“删除用户”选项?
- python - 将合并的 df 从 python 导入到 pgadmin
- couchbase - Couchbase 同步网关多个客户端
- firebase - 这个系统设计可以改进吗?
- python - 我将如何拆分 python 字符串并保留分隔符,但分隔符不是单独的列表项?
- reactjs - 凸轮我向后端发送不同的 URL,即使服务器 url 作为前端的 id 值发送?
- prolog - prolog中递归规则中的常量递增变量