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

相关推荐
stevenzqzq2 小时前
颜色透明度转换技术文档(Android/Compose)
android
巴黎没有摩天轮Li2 小时前
Android JVMTI 接入流程
android
2501_915909063 小时前
iOS 抓包不越狱,代理抓包 和 数据线直连抓包两种实现方式
android·ios·小程序·https·uni-app·iphone·webview
城东米粉儿3 小时前
Android VCL 和 NAL笔记
android
常利兵3 小时前
从0到1,解锁Android WebView混合开发新姿势
android·华为·harmonyos
背包客(wyq)4 小时前
基于Android手机的语音数据采集系统(语音数据自动上传至电脑端)
android·网络
不止二进制4 小时前
从 0 到 1 理解 LinearLayout:Android 布局入门实战
android
不止二进制4 小时前
Android |FrameLayout 帧布局实战 ——NeonLamp 霓虹灯效果详解
android
stevenzqzq4 小时前
Kotlin 进阶指南:中缀函数 (Infix Function)
android·kotlin·compose