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

相关推荐
Kapaseker1 小时前
详解 Compose background 的重组陷阱
android·kotlin
黄林晴2 小时前
Kotlin 2.3.20-RC2 来了!JPA 开发者狂喜,6 大更新一文速览
android·kotlin
kymjs张涛16 小时前
OpenClaw 学习小组:初识
android·linux·人工智能
糖猫猫cc19 小时前
Kite:填充处理器
kotlin·orm·kite
范特西林19 小时前
实战演练——从零实现一个高性能 Binder 服务
android
范特西林20 小时前
代码的生成:AIDL 编译器与 Parcel 的序列化艺术
android
范特西林20 小时前
深入内核:Binder 驱动的内存管理与事务调度
android
范特西林21 小时前
解剖麻雀:Binder 通信的整体架构全景图
android
范特西林21 小时前
破冰之旅:为什么 Android 选择了 Binder?
android
奔跑中的蜗牛6661 天前
一次播放器架构升级:Android 直播间 ANR 下降 60%
android