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

相关推荐
俩个逗号。。2 小时前
Gradle 踩过的坑
android
土星碎冰机5 小时前
ai自学笔记(3.安卓篇,制作app
android·笔记·ai
随遇丿而安6 小时前
专题:Glide / Coil / Fresco,不是三种写法,而是三套图片加载思路
android
只可远观7 小时前
Android 自动埋点(页面打开 / 关闭 + 点击事件)完整方案
android·kotlin
私人珍藏库8 小时前
【Android】小小最新AI--千变万化扮演任何角色--沉浸式互动
android·app·工具·软件·多功能
zh_xuan8 小时前
Android MVI架构
android·mvi
测试开发-学习笔记9 小时前
Airtest+Poco快速上手
android·其他
李斯维9 小时前
Android Jetpack 简介:由来和演进
android·android studio·android jetpack
阿巴斯甜9 小时前
ARouter 的使用:
android
沐言人生9 小时前
ReactNative 源码分析9——Native View初始化
android·react native