material BottomNavigationView 在键盘启动时隐藏图标

问题描述 投票:0回答:0

我有一个简单的材料 BottomAppBar 和 BottomNavigationView,我看到一个奇怪的行为:每次它显示在键盘上方(添加此栏的活动有

android:windowSoftInputMode="adjustResize"
)该栏上的菜单图标消失。当键盘被隐藏时 - 图标又回来了。任何想法表示赞赏

<androidx.coordinatorlayout.widget.CoordinatorLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/parentCoordinatorLayout"
   android:layout_width="match_parent"
   android:layout_height="match_parent">

.....
    <com.google.android.material.bottomappbar.BottomAppBar
       android:id="@+id/bottomAppBar"
       android:layout_width="match_parent"
       android:layout_height="60dp"
       app:fabCradleMargin="10dp"
       app:fabCradleRoundedCornerRadius="0dp"
       app:fabCradleVerticalOffset="10dp">

       <com.google.android.material.bottomnavigation.BottomNavigationView
           android:id="@+id/bottomNavigationView"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:layout_marginEnd="16dp"
           app:menu="@menu/bottom_navigation" />

    </com.google.android.material.bottomappbar.BottomAppBar>

   <com.google.android.material.floatingactionbutton.FloatingActionButton
       android:id="@+id/profileCloseFab"
       android:layout_width="57dp"
       android:layout_height="57dp"
       android:contentDescription="@string/app_name"
       app:borderWidth="0dp"
       android:elevation="2dp"
       android:src="@drawable/ic_bottom_menu_fab_person_gray"
       app:layout_anchor="@id/bottomAppBar" />

</androidx.coordinatorlayout.widget.CoordinatorLayout >
android material-ui android-coordinatorlayout bottom-navigation-bar
© www.soinside.com 2019 - 2024. All rights reserved.