关闭 Android SplashScreen(闪屏)

SplashScreen在Android 12上是强制的,如果你什么都不做,你的App在Android 12上就会自动拥有SplashScreen界面

但是这个SplashScreen界面太局限了能改的地方太少了

其实也没什么他主要作用是为了在App启动初始化的时候避免让用户在一个空白界面等待过长时间,一定程度上提升用户体验。

关闭这个闪屏也简单 把启动Activity的主题替换一下就好了比如:

XML 复制代码
    <style name="SplashScreen" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:screenOrientation">portrait</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>

如果你想自定义SplashScreen 可以继承R.style.Theme_SplashScreen 或者 R.style.Theme_SplashScreen_IconBackground.参考
SplashScreen | Android Developers

相关推荐
ForteScarlet2 小时前
从 Kotlin 编译器 API 的变化开始: 2.3.20
android·开发语言·后端·ios·开源·kotlin
私人珍藏库2 小时前
[Android] 假装来电 v1.1.0
android·app·工具·软件·多功能
spencer_tseng3 小时前
Android Studio [Gradle JDK]
android·ide·android studio
sun0077004 小时前
wifi热点的防火墙
android
Code-Porter4 小时前
记录关于Flutter ObjectBox数据库使用ObjectBoxBrowser插件,在同一个局域网内电脑无法访问查看数据问题
android·数据库·flutter·dart
KongHen024 小时前
Android Studio最新版汉化教程(2025年10月17日)
android·ide·android studio
键盘鼓手苏苏4 小时前
Flutter for OpenHarmony:使用 typed_data 直击高性能底层数据操作核心
android·flutter·华为·自动化·harmonyos
左手厨刀右手茼蒿4 小时前
Flutter for OpenHarmony:mailer — 基于 SMTP 的极速邮件投递服务(适配鸿蒙 HarmonyOS Next ohos)
android·flutter·华为·交互·harmonyos
取码网5 小时前
getapp影视APP源码 反编译APP附教程
android·php
hnlgzb6 小时前
请详细解释一下MVVM这个设计模型
android·kotlin·android jetpack·compose