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

相关推荐
Kapaseker14 小时前
一杯美式讲完 Sealed Class
android·kotlin
冬奇Lab1 天前
PowerManagerService(下):Doze模式与电池优化
android·源码阅读
砖厂小工1 天前
Compose 中函数引用 vs Lambda:到底该用哪个?
android
Kapaseker2 天前
详解 Compose background 的重组陷阱
android·kotlin
黄林晴2 天前
Kotlin 2.3.20-RC2 来了!JPA 开发者狂喜,6 大更新一文速览
android·kotlin
kymjs张涛2 天前
OpenClaw 学习小组:初识
android·linux·人工智能
糖猫猫cc2 天前
Kite:填充处理器
kotlin·orm·kite
范特西林2 天前
实战演练——从零实现一个高性能 Binder 服务
android
范特西林2 天前
代码的生成:AIDL 编译器与 Parcel 的序列化艺术
android
范特西林2 天前
深入内核:Binder 驱动的内存管理与事务调度
android