1. 设置Theme
false
false
@android:color/transparent
2.设置最外层布局
注意外层布局必须为CoordinatorLayout,其他布局会有问题,且必须设置android:fitsSystemWindows为true,下面的imageView为要沉浸的布局,必须为imageView,其他布局可能会有偿,且必须设置android:fitsSystemWindows为true,这样,一个沉浸式的布局就好了
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:background="@drawable/m_maker_home_top_bg"
/>