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

相关推荐
robotx14 分钟前
AOSP 设置-提示音和振动 添加一个带有开关(Switch)的设置项
android
青莲84319 分钟前
RecyclerView 完全指南
android·前端·面试
青莲84320 分钟前
Android WebView 混合开发完整指南
android·前端·面试
龙之叶39 分钟前
【Android Monkey源码解析三】- 运行解析
android
KevinWang_2 小时前
Android 的 assets 资源和 raw 资源有什么区别?
android
码农幻想梦3 小时前
2021Android从零入门到实战(慕课网官方账号)
android
Jomurphys3 小时前
Android 架构 - 组件化 Modularzation
android
明明明h3 小时前
【Unity3D】Android App Bundle(aab)打包上架Google Play介绍
android
花卷HJ3 小时前
Android 通用 RecyclerView Adapter 实现(支持 ViewBinding + 泛型 + 点击事件)
android
oMcLin3 小时前
如何在Ubuntu 22.04 LTS上配置并优化MySQL 8.0分区表,提高大规模数据集查询的效率与性能?
android·mysql·ubuntu