这样当装哪个cordova插件时,再装对应的native子模块即可(以@ionic-native做前缀),如下面所示: ionic cordova plugin add splash-screen; ionic-native/splansh-screen --save; 最后会反映到package.json里, "@ionic-native/core":"3.12.1", "@ionic-native/splash-screen
在Android 12中,官方添加了SplashScreen API(https://developer.android.google.cn/about/versions/12/features/splash-screen 这里官方给出了一些意见,大家可以参考一下:将现有的启动画面实现迁移到 Android 12 及更高版本(https://developer.android.google.cn/guide/topics/ui/splash-screen
ionic-angular'; import {StatusBar} from '@ionic-native/status-bar'; import {SplashScreen} from '@ionic-native/splash-screen
image 更详细的介绍这里就不展开了,有兴趣的可以自己看官方的资料: https://developer.android.com/guide/topics/ui/splash-screen ,这里主要介绍下如何适配和使用的问题 关于如何迁移和使用 SplashScreen 可以查阅官方详细文档: https://developer.android.com/guide/topics/ui/splash-screen/migrate
这就是我们搭建新项目时 app.json 文件的样子: /* app.json */ { "expo": { "name": "splash-screen", "slug": "splash-screen
import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen
https://developer.android.google.cn/guide/topics/ui/splash-screen 3.如果是因为某些不可抗拒的原因(例如一些大型游戏的首次加载),导致第一次启动非常慢的话
androidx/core/splashscreen/SplashScreen [22] 启动画面: https://developer.android.google.cn/guide/topics/ui/splash-screen