简体   繁体   English

Android:底部菜单栏隐藏回收站视图

[英]Android : Bottom Menu Bar Hides the Recycler View

in my app i created a bootom menubar layout with floating button and i include that in my main activity and also i place a recycler view in my main activity在我的应用程序中,我创建了一个带有浮动按钮的引导菜单栏布局,并将其包含在我的主要活动中,并且我还在我的主要活动中放置了一个回收器视图

i just add 100 items to display in my recyclerview to check whether it was working or not for that when i run my application the recycler view of last item hides inside the bottom menu bar how to solve this我只是添加了 100 个项目以显示在我的回收站视图中以检查它是否在运行我的应用程序时它是否正常工作,最后一个项目的回收站视图隐藏在底部菜单栏中如何解决这个问题

here is the sample image of what i said这是我所说的示例图像

在此处输入图片说明

activity_main.xml活动_main.xml

 <include
        layout="@layout/toolbar"
        android:id="@+id/toolbar"
        />


 <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        />

    <include
        android:id="@+id/bottom_nav"
        layout="@layout/bottom_menu_bar"
        />

bottom menu bar.底部菜单栏。 xml xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/relativeLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_nav"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:menu="@menu/bottom_nav_menu" />


    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/margin_padding"
        android:src="@drawable/ic_add"
        android:tint="@color/colorWhite"
        app:backgroundTint="@color/colorPrimary"
        app:layout_anchor="@id/bottom_nav"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:elevation="@dimen/floating_b_ele"
        android:clickable="true"
        android:focusable="true"
        />


</androidx.constraintlayout.widget.ConstraintLayout>

向 RecyclerView 添加一个 layout_marginBottom,它等于底部导航的高度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM