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

相关推荐
Tom4i13 分钟前
Perfetto 快速上手
android·性能优化·perfetto
fatiaozhang95271 小时前
创维桌面云终端-创维LB2002-黑盒-国科gk6323-2+8G-短接强刷固件包
android·电视盒子·刷机固件·机顶盒刷机·创维lb2002·创维lb2002-黑盒·创维lb2002-白盒
q***71857 小时前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb
IT痴者9 小时前
《PerfettoSQL 的通用查询模板》---Android-trace
android·开发语言·python
游戏开发爱好者89 小时前
iOS IPA 上传工具全面解析,从 Transporter 到开心上架(Appuploader)命令行的高效上架实践
android·ios·小程序·https·uni-app·iphone·webview
alexhilton11 小时前
Jetpack Compose中的阴影艺术
android·kotlin·android jetpack
百***618714 小时前
Spring的构造注入
android·java·spring
Tom4i14 小时前
Kotlin 中的 inline 和 reified 关键字
android·开发语言·kotlin
yi诺千金15 小时前
Android U 自由窗口(浮窗)——启动流程(system_server侧流程)
android
清空mega17 小时前
第11章 网络编程
android·网络