工作总结
- 针对DrawerLayout中侧边栏NavigationView沉浸式状态栏无效问题,疏忽了一个问题,需要设置Activity的Style中
<item="WindowTranslucentStatus">true</item> 属性,同时在设置NavigationView属性为 android:fitsSystemWindows="true",即可完成沉浸式状态栏效果 - 设置下列效果
![效果](http://upload-images.jianshu.io/upload_images/2789715-446ec54feb3c1fde.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
效果
设置Activity的布局中的父布局android:fitsSystemWindows="false",因为图片为AppBarLayout包裹,所以设置其android:fitsSystemWindows="true",同时设置包裹ImageView的父布局为android:fitsSystemWindows="true"
参照完整的Activity布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.