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

相关推荐
Lei活在当下23 分钟前
Codex 工程化实践指南:深入理解 AGENTS.md、SKILL.md 与 MCP
android·openai·ai编程
修炼者1 小时前
Toast的显示流程
android
simplepeng4 小时前
Room 3.0 KMP Alpha-01
android·kotlin·android jetpack
Lei活在当下4 小时前
Windows 下 Codex 高效工作流最佳实践
android·openai·ai编程
fatiaozhang95274 小时前
基于slimBOXtv 9.19.0 v4(通刷晶晨S905L3A/L3AB芯片)ATV-安卓9-完美版线刷固件包
android·电视盒子·刷机固件·机顶盒刷机·晶晨s905l3ab·晶晨s905l3a
私房菜6 小时前
Selinux 及在Android 的使用详解
android·selinux·sepolicy
一只特立独行的Yang6 小时前
Android中的系统级共享库
android
两个人的幸福online6 小时前
php开发者 需要 协程吗
android·开发语言·php
修炼者8 小时前
WindowManager(WMS)构建全局悬浮窗
android
xiaoshiquan12068 小时前
Android Studio里,SDK Manager显示不全问题
android·ide·android studio