BottomAppBar在使用软键盘时会提升

问题描述 投票:0回答: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"/>
java android android-bottomappbar
1个回答
0
投票

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

android:windowSoftInputMode="adjustPan|stateHidden"

© www.soinside.com 2019 - 2024. All rights reserved.