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

相关推荐
城东米粉儿20 分钟前
Android消息机制 笔记
android
诸神黄昏EX25 分钟前
Android SystemServer 系列专题【篇五:SystemConfig系统功能配置】
android
城东米粉儿26 分钟前
Android IdleHandler 优化笔记
android
城东米粉儿26 分钟前
Android Binder 笔记
android
Android系统攻城狮27 分钟前
Android tinyalsa深度解析之pcm_get_available_min调用流程与实战(一百一十六)
android·pcm·tinyalsa·音频进阶·音频性能实战
lxysbly33 分钟前
nds模拟器安卓版官网
android
hewence133 分钟前
协程间数据传递:从Channel到Flow,构建高效的协程通信体系
android·java·开发语言
前端不太难35 分钟前
为什么鸿蒙不再适用 Android 分层
android·状态模式·harmonyos
2501_9160074740 分钟前
ios上架 App 流程,证书生成、从描述文件创建、打包、安装验证到上传
android·ios·小程序·https·uni-app·iphone·webview