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

相关推荐
c***21294 小时前
Springboot3学习(5、Druid使用及配置)
android·学习
修炼者4 小时前
【Android 进阶】别再强转 Context 了!手把手教你优雅解耦 View 与 Activity
android·android studio
x***01065 小时前
SpringSecurity+jwt实现权限认证功能
android·前端·后端
程序员江同学5 小时前
线下活动|2025 Kotlin 中文开发者大会北京分会场
android·kotlin
李坤林6 小时前
Android Vulkan 开启VK_GOOGLE_DISPLAY_TIMING 后,一个vsync 会释放两个imageBuffer现象分析
android·vulkan
Jerry6 小时前
Compose 状态思维
android
k***45997 小时前
MySQL----case的用法
android·数据库·mysql
r***86988 小时前
Plugin ‘mysql_native_password‘ is not loaded`
android·数据库·mysql
v***59838 小时前
MySQL-mysql zip安装包配置教程
android·mysql·adb
不用89k9 小时前
Android无法区分USB摄像头是哪一个
android