启动页创建style,清单文件里单独给启动页的theme设置为该style
<style name="Theme.Splash" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge"> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowBackground">@drawable/bg_splash</item> <item name="android:windowFullscreen">true</item> <item name="android:fitsSystemWindows">true</item> <item name="android:windowDrawsSystemBarBackgrounds">false</item> <item name="android:windowTranslucentStatus">true</item><!--这行代码使布局占据状态栏空间--> </style>
跳转下个页面时会出现闪动,
一定先关闭当前闪屏页,再去打开下个页面解决此问题