現(xiàn)在style中設(shè)置主題触徐,添加如下代碼
<item name="android:windowTranslucentStatus">true</item>
然后在布局文件中添加如下代碼
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"http://這句代碼是填充滿(mǎn)狀態(tài)欄,注意必須是在DrawerLayout中fitsSystemWindows屬性才會(huì)生效>
...
</android.support.v4.widget.DrawerLayout>