Tob*_*s D 0 xml android bottomnavigationview
我有一个 editText 视图、一个 RecyclerView 和一个底部导航视图。当我提示 EditText 时,键盘会打开并且 RecyclerView 被填充。但是BottomNavigationview 仍然在现在打开的键盘之上,而我的Recyclerview 在bottomnavigation 视图之上。现在 recyclerview 和 edittext 在键盘打开时重叠。有没有办法限制在键盘打开时底部导航视图消失?
这是我的 xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Abfahrtsmonitor">
<EditText
android:id="@+id/editText"
android:layout_width="360dp"
android:layout_height="47dp"
android:ems="10"
android:hint="Suche"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="7dp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/Recycleview"
android:layout_width="370dp"
android:layout_height="441dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="4dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toTopOf="@+id/navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<android.support.design.widget.BottomNavigationView
android:layout_width="368dp"
android:layout_height="48dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="511dp"
android:id="@+id/navigation"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation"/>
Run Code Online (Sandbox Code Playgroud)
在 Manifest 中定义的活动标签中执行以下操作。
<activity
android:name=".YourActivity"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing"/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1711 次 |
| 最近记录: |