android - 我有 RecyclerView 和底部应用栏,但它不显示底部应用栏
问题描述
我有 RecyclerView 和底部应用栏,但它没有显示底部应用栏。我应该在我的代码中添加什么?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/include"
layout="@layout/appbar"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:menu="@menu/bottom_app_bar">
</com.google.android.material.bottomnavigation.BottomNavigationView>
</LinearLayout>
解决方案
尝试这个 :
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/recycler"/>
推荐阅读
- javascript - 如何将值数组添加到 Set
- docker - 有没有办法直接将容器从 docker hub 部署到 google 计算引擎?
- gnuplot - 如何在 gnuplot 中创建重叠条形图
- xml - Apache FOP:Eclipse Maven 项目中的图像相对路径?
- visual-studio - 免费练习 TFS
- firebase - 在 Flutter 上使用电子邮件和密码进行 Firebase 身份验证的示例?
- python - 张量流损失为负
- c++ - 'operator=' 的 nlohmann json 模棱两可的重载
- gulp - Teamcity,将参数传递给 gulpconfig
- python - Matlab 到 Python 矩阵代码