关闭 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

相关推荐
问心无愧051312 小时前
ctf show web入门261
android·前端·笔记
alexhilton12 小时前
车载系统中的可扩展UI:从UI嵌入到系统窗口编排
android·kotlin·android jetpack
Cloud_Shy61812 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第一章 Item 4 - 6)
android·数据库·论文阅读·python
therese_1008613 小时前
安卓面试题
android
码云骑士13 小时前
Android Launcher启动过程
android
Java面试题总结13 小时前
MySQL EXISTS 详解:存在性判断、NOT EXISTS 与实战示例
android·数据库·mysql
_李小白14 小时前
【android opencv学习笔记】Day 30: 滤波算法之拉普拉斯算子
android·opencv·学习
NiceCloud喜云1 天前
Opus 4.8 的 Effort Control 怎么选:Low 到 Max 五档策略
android·java·大数据·前端·c++·python·spring
日光明媚1 天前
一步生成视频!One-Forcing:DMD + 零成本 GAN,训练 200 步超越多步 SOTA
android·开发语言·kotlin
帅次1 天前
Android 17 开发者实战:核心更新与应用场景落地指南
android·java·ios·android studio·iphone·android jetpack·webview