使用软键盘时 BottomAppBar 升高

BottomAppBar raises while using soft keyboard

我试图将 BottomAppBar 隐藏在键盘后面,但是当我将焦点转移到另一个 EditText 的部分时BottomAppBar 开始像 photo 那样出现。我也已经尝试更改 windowSoftInputMode 但我真的需要 adjustPan.

    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/bottom_appbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:layout_gravity="bottom"
        app:backgroundTint="@color/colorAccent"
        app:fabCradleMargin="@dimen/fab_margin"
        app:fabCradleRoundedCornerRadius="@dimen/fab_corner_radius"
        app:hideOnScroll="false"
        app:layout_scrollFlags="scroll|enterAlways"
        android:transitionName="bottom_appbar"
        style="@style/Widget.MaterialComponents.BottomAppBar" />

     <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/bottom_fab"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:clickable="true"
        app:tint="@color/colorPrimary"
        android:tint="@color/colorPrimary"
        app:backgroundTint="@color/floatButtonColor"
        app:rippleColor="@color/colorAccent"
        app:layout_anchor="@id/bottom_appbar"/>

尝试将此添加到清单中的 <activity> 标签

android:windowSoftInputMode="adjustPan|stateHidden"