According to the material design spec, when the keyboard appears, the BottomNavigationView
should hide underneath it. However, if I set android:windowSoftInputMode="adjustResize"
in the Activity's manifest then the BottomNavigationView
moves above the keyboard.
I need to set adjustResize
to enable scrolling to the bottom of the screen while the keyboard is open. However, I do not want the BottomNavigationView
to be visible. Can this be done?
How it currently looks:
The layout XML (in reality there would be a FrameLayout
where the EditText
is and the EditText
would be inside it):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Input"
android:layout_gravity="center"
android:layout_centerVertical="true"/>
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:itemBackground="@color/colorPrimary"
app:menu="@menu/menu_bottom_navigation"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"/>
</RelativeLayout>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…