使用软键盘时BottomAppBar升高

时间:2019-04-12 09:18:27

标签: java android android-bottomappbar

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

1 个答案:

答案 0 :(得分:0)

尝试将其添加到清单中的<activity>标记中

android:windowSoftInputMode="adjustPan|stateHidden"