今天难得有时间写一写关于最近的总结,在每日的忙碌之中时刻保持本心,避免让自己迷失在每日的时光流逝中,不知道看到的朋友们是否有相同的感觉~ 发一下牢骚,接下来我们来看一下沉浸式的实现
首先我们要在styles文件里面进行配置修改
<resources> <!-- Base application theme. --> <!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">--> <!--<!– Customize your theme here. –>--> <!--<item name="colorPrimary">@color/colorPrimary</item>--> <!--<item name="colorPrimaryDark">@color/colorPrimaryDark</item>--> <!--<item name="colorAccent">@color/colorAccent</item>--> <!--</style>--> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- 虚拟按键不透明 --> <item name="android:windowTranslucentNavigation">false</item> <!-- 透明状态栏 --> <item name="android:windowTranslucentStatus">false</item> <!-- 界面不沉浸到状态栏下方 --> <item name="android:fitsSystemWindows">true</item> <item name="colorPrimaryDark">@color/banner_color</item> <item name="android:windowNoTitle">true</item> </style> <style name="ActivityTheme" parent="AppTheme"> <item name="android:windowNoTitle">true</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">false</item> <item name="android:fitsSystemWindows">false</item> </style> <style name="StartAppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@mipmap/flash</item> <item name="android:windowTranslucentStatus">true</item> </style> </resources>
然后新建values-v19 values-v21 同时在两个文件夹下面复制粘贴刚才的styles文件,打开AndroidManifest.xml 在你的application下面设置如下 最后运行。
android:theme="@style/AppTheme">