关闭 Android SplashScreen(闪屏)

编程入门 行业动态 更新时间:2024-10-08 13:28:30

关闭 <a href=https://www.elefans.com/category/jswz/34/1771384.html style=Android SplashScreen(闪屏)"/>

关闭 Android SplashScreen(闪屏)

SplashScreen在Android 12上是强制的,如果你什么都不做,你的App在Android 12上就会自动拥有SplashScreen界面
但是这个SplashScreen界面太局限了能改的地方太少了
其实也没什么他主要作用是为了在App启动初始化的时候避免让用户在一个空白界面等待过长时间,一定程度上提升用户体验。
关闭这个闪屏也简单 把启动Activity的主题替换一下就好了比如:

    <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 SplashScreen(闪屏)

本文发布于:2023-11-17 04:28:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Android   SplashScreen   闪屏

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!