完成沉浸式其實網上有很多的辦法
我這裡面只提供一種但是我感覺這種方式很自由,
在styles裡面
<stylename=parent=>
<itemname="colorprimary">@color/colorbaseitem>
<itemname="colorprimarydark">@color/colorprimarydarkitem>
<itemname="coloraccent">@color/coloraccentitem>
<itemname="android:windowtranslucentstatus">trueitem>
style>
在styles裡面設定 <itemname="android:windowtranslucentstatus">trueitem>
在
manifest
裡面設定:
android:allowbackup="true"android:icon="@mipmap/ic_launcher"android:label=
android:supportsrtl="true"android:theme=
android:name=
>
在每乙個布局裡面設定
<linearlayoutxmlns:android=""xmlns:tools=""android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:cliptopadding="false">這樣的話就可以實現全屏 狀態列被隱藏掉 但是狀態列裡面的東西 像電量啊。。。這些都還存在,這樣你自己可以做的東西就多了 可以任意定義就像你自己的布局一樣
Android沉浸式狀態列
市場上,現階段很流行android沉浸式開發,但是限於google api的限制,所以此特性只能針對android4.4,github上目前開源的systembartint能夠很好的實現此特性。android 4.4 特有屬性,android 5.0以上機型,預設開啟。1 利用android stu...
android沉浸式狀態列
在 中設定 if build.version.sdk int build.version codes.kitkat 複製 通過檢視windowmanager.layoutparams.flag translucent status的官方注釋,有這麼一句話 when this flag is enab...
Android透明狀態列 沉浸式狀態列
注意 android版本 4.4此方法有效 第一步 在activity的布局檔案中,根布局中加入以下第5 7行 第二步 新建類kitkatutils.class package cn.powerthink.djt.utils import android.annotation.suppresslin...