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

相关推荐
消失的旧时光-194312 分钟前
Kotlin when 用法完整分享
android·开发语言·kotlin
麋鹿原22 分钟前
Android Room 数据库之数据库升级
数据库·kotlin
麋鹿原2 小时前
Android Room 数据库之简单上手
前端·kotlin
顾林海2 小时前
Android编译插桩黑科技:ReDex带你给App"瘦个身,提个速"
android·面试·性能优化
maki0773 小时前
VR大空间资料 04 —— VRAF使用体验和源码分析
android·vr·虚幻·源码分析
消失的旧时光-19435 小时前
Kotlin 判空写法对比与最佳实践
android·java·kotlin
锅拌饭6 小时前
Android Handler(一) 同步屏障泄露导致页面假死
android
锅拌饭6 小时前
Android Handler(二) 同步屏障泄露检测
android
手机不死我是天子7 小时前
《Android 核心组件深度系列 · 第 3 篇 BroadcastReceiver》
android·android studio