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

相关推荐
薿夜21 分钟前
SpringSecurity(三)
android
zh_xuan6 小时前
Android Hilt实现依赖注入
android·hilt
freshman_y6 小时前
Qtcreator怎么新建安卓项目?编写一个五子棋游戏APP?
android·qt
时寒的笔记7 小时前
js逆向7_案例惠nong网
android·开发语言·javascript
雨白7 小时前
深入理解 Kotlin 协程 (三):返璞归真,探寻协程基础设施的底层基石
kotlin
肯多洛夫斯基8 小时前
安卓工控屏静默连WiFi全攻略
android
极梦网络无忧8 小时前
Android无障碍服务实现抖音直播间界面监控(场控助手核心原理)
android
call me by ur name9 小时前
ERNIE 5.0 Technical Report论文解读
android·开发语言·人工智能·机器学习·ai·kotlin
kerli9 小时前
Compose 组件:Box 核心参数及其 Bias 算法
android·前端
BLUcoding10 小时前
Android 常用控件及核心属性
android