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

相关推荐
tangweiguo0305198738 分钟前
Android SSE 流式接收:从手写到框架的进阶之路
android
大尚来也1 小时前
PHP 反序列化漏洞深度解析:从原理利用到 allowed_classes 防御实战
android·开发语言·php
sp42a1 小时前
通过 RootEncoder 进行安卓直播 RTSP 推流
android·推流·rtsp
SY.ZHOU2 小时前
移动端架构体系(一):组件化
android·ios·架构·系统架构
恋猫de小郭3 小时前
Android 17 新适配要求,各大权限进一步收紧,适配难度提升
android·前端·flutter
流星白龙3 小时前
【MySQL】9.MySQL内置函数
android·数据库·mysql
进击的cc3 小时前
Android Kotlin:扩展函数如何优雅封装Android API
android·kotlin
进击的cc3 小时前
Android Kotlin:空安全机制在Android中的实战应用
android·kotlin
没有了遇见5 小时前
Android 实现天猫/京东/抖音/咸鱼/拼多多等商品详情页面智能跳转APP
android
乾坤一气杀6 小时前
Kotlin 协程线程切换原理 —— 以 Dispatchers.IO 为例
android