Tencent / QMUI_Android

提高 Android UI 开发效率的 UI 库
http://qmuiteam.com/android
Other
14.42k stars 2.67k forks source link

qmui 1.4.4 QMUIWindowInsetLayout在mvvm中配合使用时,QMUITopBarLayout使用fitsSystemWindows="true"无效,会顶到状态栏 #1107

Open amazingztz opened 3 years ago

amazingztz commented 3 years ago

<layout 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" xmlns:binding="http://schemas.android.com/apk/res-auto" tools:context=".ui.BindPhoneFragment"

<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white"

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fitsSystemWindows="true"
    android:fillViewport="true"
    />

<com.qmuiteam.qmui.widget.QMUITopBarLayout
    android:id="@+id/top_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fitsSystemWindows="true"
    />

</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

mvvm xml最外层还有个 这个粘贴出来的没显示 image

Screenshot_2021-07-29-10-40-15-879_com wln smartfarm

xiaoyaomeng commented 3 years ago

因为QMUIWindowInsetLayout这个的基类是FrameLayout,据我目前看,QMUI仅仅支持LinnearLayout的沉浸式状态栏。