Application启动背景图,冷启动,Activity全屏,悬浮窗悬浮
前序:网上一搜很多都是通过代码:getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LAYOUT_STATABLE);getWindow().setStatusBarColor(Color.TRANSPARENT);等等。
经过我反复测验:style进行实现更加的完美。
如下:
<!-- Base application theme. --><style name="AppWelcomeTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- 布局全屏,状态栏隐藏. 应用启动带有背景-->
<item name="android:windowBackground">@mipmap/welcome_bg</item><item name="windowNoTitle">true</item><item name="windowActionBar">false</item><item name="android:windowFullscreen">true</item></style>
<style name="AppTranslucentTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- 布局全屏,状态栏隐藏.-->
<item name="windowNoTitle">true</item><item name="windowActionBar">false</item><item name="android:windowFullscreen">true</item></style>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- 布局全屏,状态栏悬浮之上. -->
<item name="windowNoTitle">true</item><item name="windowActionBar">false</item><item name="android:windowTranslucentStatus">true</item></style>
<style name="AppFullscreenStatusTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- 布局全屏,状态栏悬浮. -->
<item name="windowNoTitle">true</item><item name="windowActionBar">false</item><item name="android:windowTranslucentStatus">true</item></style>
如需获取更多有料内容,请持续关注 https://github.com/pdliugithub
App启动背景图,冷启动,Activity全屏,悬浮窗悬浮
最新推荐文章于 2022-11-23 10:23:54 发布