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

相关推荐
.豆鲨包32 分钟前
【Android】组件化搭建的一般流程
android
心有—林夕1 小时前
MySQL 误操作恢复完全指南
android·数据库·mysql
忙什么果2 小时前
Mamba学习笔记2:Mamba模型
android·笔记·学习
Wyawsl2 小时前
MySQL故障排查与优化
android·adb
私人珍藏库4 小时前
[Android] 后台视频录制 FadCam v3.0.1
android·app·工具·软件·多功能
Z_Wonderful4 小时前
在 **Next.js** 中使用 `mysql2` 连接 MySQL 数据库并查询 `xxx` 表的数据
android·数据库
FirstFrost --sy4 小时前
MySql 内外连接
android·数据库·mysql
激昂网络4 小时前
在Ubuntu 24.04上编译T527 Android系统:遇到的几个问题及解决方法
android·linux·ubuntu
李艺为5 小时前
android客制开发之DevCheck检测CPU核心作假
android
hnlgzb5 小时前
LiveData和MutableLiveData都是什么?有什么区别?都是在什么情况下用?
android