android - android中的底部导航重叠回收器 View 内容

标签 android xml android-layout bottomnavigationview

我正在使用底部导航 View 并显示三个选项卡,在其中一个选项卡中我添加了回收器 View ,但内容被底部导航重叠。无法滚动回收器 View 。有什么方法可以隐藏当我在回收站 View 上滚动项目时底部导航。

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    xmlns:sv="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:context=".activity.patient.PatientsActivity">

        <include
            layout="@layout/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <RelativeLayout
            android:id="@+id/asd"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="60dp"
            android:orientation="vertical">

            <co.moonmonkeylabs.realmrecyclerview.RealmRecyclerView
                android:id="@+id/appointmentsList"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:rrvEmptyLayoutId="@layout/empty_view"
                app:rrvLayoutType="LinearLayout"
                app:rrvSwipeToDelete="true" />

            <android.support.design.widget.BottomNavigationView
                android:id="@+id/bottom_navigation"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                app:itemBackground="@color/white"
                app:layout_behavior=".BottomNavigationBehavior"
                app:menu="@menu/bottom_navigation_main" />
        </RelativeLayout>
    </android.support.design.widget.CoordinatorLayout> </android.support.v4.widget.DrawerLayout>

image

最佳答案

首先我认为你可以添加:

android:layout_above="@id/bottom_navigation"

到回收站

对于滚动部分,我建议寻找一个 ScrollingBehaviour 就像这个问题: How to scroll up/down of bottom bar on scrolling of RecyclerView

关于android - android中的底部导航重叠回收器 View 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44428877/

相关文章:

java - Android - 尝试在 onCreate() 内调用另一个类的方法

android - 改造 android 不工作和改造错误 401

android - 将 Courier 字体添加到项目中

java - 如何在 JAVA 中(以 XQJ 或任何其他方式)使用 Xquery 3.1(新功能,如映射和数组)?

mysql - 在 MySQL 表列中提取 XML

java - 使用自定义适配器在 AlertDialog 中单击监听器

java - 加载 XML 非常慢

android - 将焦点或点击传递给子 EditText

android - RelativeLayout 在 onGlobalLayout 中更改高度并保留宽度以填充

android - 在 onCreateView 中向 listFragment 添加静态 header