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

相关推荐
hjlgs5 小时前
framework修改快速验证
android
游戏开发爱好者86 小时前
iOS 开发者的安全加固工具,从源码到成品 IPA 的多层防护体系实践
android·安全·ios·小程序·uni-app·cocoa·iphone
安卓理事人6 小时前
安卓内存泄露排查LeakCanary
android
秃了也弱了。8 小时前
MySQL空间函数详解,MySQL记录经纬度并进行计算
android·数据库·mysql
.豆鲨包8 小时前
【Android】Binder机制浅析
android·binder
Nerve10 小时前
GooglePay: API 文档
android·google
Nerve10 小时前
GooglePay: 订阅商品购买流程
android·google
summerkissyou198710 小时前
Audio-触摸音-播放流程
android
Nerve10 小时前
GooglePay: 消耗商品购买流程
android·google
LiteHeaven10 小时前
Android 8.1 Unable to create application data 问题分析
android