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

相关推荐
Android系统攻城狮7 分钟前
Android ALSA进阶之处理PCM的ioctl命令snd_pcm_lib_ioctl:用法实例(一百)
android·pcm·alsa·音频进阶
诸神黄昏EX8 小时前
Android Build系列专题【篇六:VINTF机制】
android
浪客川9 小时前
安卓日志工具类
android
csj509 小时前
安卓基础之《(14)—数据存储(4)应用组件Application》
android
李坤林10 小时前
Android Binder 详解(6) Binder 客户端的创建
android·binder
北京自在科技10 小时前
苹果iOS 26.3实现跨安卓数据无缝迁移
android·ios·findmy
_道隐_10 小时前
Android里面的layer、DisplayList和hardwarebuffer之间是什么关系
android
stevenzqzq11 小时前
ctrl +B和ctrl+shift +B的区别
android·ide·android studio
似霰12 小时前
HIDL Hal 开发笔记5----Same-Process HALs 实例分析
android·framework·hal
robotx12 小时前
安卓16 设置壁纸中应用网格,有两个5X5的选项
android