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

相关推荐
JJay.1 天前
Android BLE 稳定连接的关键,不是扫描,而是 GATT 操作队列
android·服务器·前端
忒可君1 天前
C# winform 自制分页功能
android·开发语言·c#
summerkissyou19871 天前
Android-线程安全-volatile
android·线程
我命由我123451 天前
Android 开发中,关于 Gradle 的 distributionUrl 的一些问题
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
su_ym81101 天前
Android 系统源码阅读与编译构建实战指南
android·framework
方白羽1 天前
《被封印的六秒:大厂外包破解 Android 启动流之谜》
android·app·android studio
IT乐手1 天前
java 对比分析对象是否有变化
android·java
做时间的朋友。1 天前
MySQL 8.0 窗口函数
android·数据库·mysql
举儿1 天前
通过TRAE工具实现贪吃蛇游戏的全过程
android
守月满空山雪照窗1 天前
深入理解 MTK FPSGO:Android 游戏帧率治理框架的架构与实现
android·游戏·架构