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

相关推荐
草明9 分钟前
android 蓝牙连接-兼容旧版本
android
鹏多多.12 分钟前
Flutter使用screenshot进行截屏和截长图以及分享保存的全流程指南
android·前端·flutter·ios·前端框架
Flywith243 小时前
【每日一技】Warp Workflow 使用示例
android·前端
冬奇Lab3 小时前
JobScheduler与WorkManager:任务调度机制
android·源码阅读
su1ka1114 小时前
kotlin(1)介绍
kotlin·intellij-idea
summerkissyou19875 小时前
Android-view-绘制流程及自定义例子
android·app
常利兵5 小时前
Android “解锁”屏幕方向:APP适配新征程
android·gitee
红藕香残玉簟秋7 小时前
【安卓学习】配置开发环境
android·学习
用户69371750013848 小时前
Android R8 深度解析:为什么 Google 用R8取代 ProGuard?
android·android studio·android jetpack