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

金:

在我的应用程序中,我使用浮动按钮创建了一个bootom菜单栏布局,并将其包含在我的主要活动中,并且还在我的主要活动中放置了回收站视图

我只添加100个项目以显示在我的recyclerview中,以检查它是否在运行我的应用程序时工作,最后一个项目的recycler视图隐藏在底部菜单栏中,如何解决此问题

这是我说的示例图片

在此处输入图片说明

activity_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"
        />

底部菜单栏。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>
迈西莉·乔希(Maithili Joshi)

将layout_marginBottom添加到RecyclerView,它等于底部导航的高度

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章