1

我试图将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"/>
4

1 回答 1

3

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

android:windowSoftInputMode="adjustPan|stateHidden"

于 2019-04-12T09:21:44.843 回答