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

相关推荐
龚礼鹏18 分钟前
图像显示框架七——createSurface的流程(基于Android 15源码分析)
android
聆风吟º28 分钟前
【Spring Boot 报错已解决】Spring Boot项目启动报错 “Main method not found“ 的全面分析与解决方案
android·spring boot·后端
Rysxt_1 小时前
Kotlin前景深度分析:市场占有、技术优势与未来展望
android·开发语言·kotlin
莫白媛1 小时前
Android开发之Kotlin 在 Android 开发中的全面指南
android·开发语言·kotlin
broadview_java11 小时前
使用 ConstraintLayout 构建自适应界面
android
wy31362282115 小时前
android——开发中的常见Bug汇总与解决方案(闪退)
android·bug
小小测试开发15 小时前
实战派SQL性能优化:从语法层面攻克项目中的性能瓶颈
android·sql·性能优化
QuantumLeap丶16 小时前
《Flutter全栈开发实战指南:从零到高级》- 26 -持续集成与部署
android·flutter·ios
StarShip18 小时前
从Activity.setContentView()开始
android
千里马学框架18 小时前
重学SurfaceFlinger之Layer显示区域bounds计算剖析
android·智能手机·sf·安卓framework开发·layer·surfaceflinger·车载开发