gpt4 book ai didi

安卓 : Bottom Menu Bar Hides the Recycler View

转载 作者:行者123 更新时间:2023-12-04 02:32:09 25 4
gpt4 key购买 nike

在我的应用程序中,我创建了一个带有 float 按钮的引导菜单栏布局,并将其包含在我的主要 Activity 中,并且我在我的主要 Activity 中放置了一个回收器 View
我只是在我的 recyclerview 中添加 100 个项目以检查它是否正常工作,当我运行我的应用程序时,最后一个项目的回收器 View 隐藏在底部菜单栏中如何解决这个问题
这是我所说的示例图像
enter image description here
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>

最佳答案

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

关于安卓 : Bottom Menu Bar Hides the Recycler View,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63657257/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com