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

相关推荐
fengci.6 小时前
ctfshow其他(web396-web407)
android
JJay.6 小时前
Android 17 大屏适配变化解
android
TE-茶叶蛋7 小时前
结合登录页-PHP基础知识点解析
android·开发语言·php
alexhilton7 小时前
Jetpack Compose元球边缘效果
android·kotlin·android jetpack
y小花8 小时前
安卓音频子系统之USBAlsaManager
android·音视频
KevinCyao9 小时前
安卓android视频短信接口怎么集成?AndroidStudio视频短信开发指南
android
Android出海9 小时前
安卓侧载强制24小时冷却,第三方APK直投买量面临停摆
android·google play·app出海·android出海·android侧载·谷歌开发者·android开发者
kerli9 小时前
Compose 组件:LazyColumn 核心参数与 key/contentType 详解
android·前端
开发者如是说10 小时前
可能是最好用的多语言管理工具
android·前端·后端
流星雨在线10 小时前
[汇总]Android Framework相关
android·framework