android 沉浸式

今天难得有时间写一写关于最近的总结,在每日的忙碌之中时刻保持本心,避免让自己迷失在每日的时光流逝中,不知道看到的朋友们是否有相同的感觉~   发一下牢骚,接下来我们来看一下沉浸式的实现   

首先我们要在styles文件里面进行配置修改

<resources>

    <!-- Base application theme. -->
    <!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
        <!--&lt;!&ndash; Customize your theme here. &ndash;&gt;-->
        <!--<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">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值