【发布时间】:2019-06-22 01:48:11
【问题描述】:
我想在BasicActivity 中添加RecyclerView。我的意思是我在EmptyActivity 和其他由android 设计的中选择了BasicActiivty。但是,RecyclerView 没有显示在正确的位置。
我尝试添加这个回收器视图,有时它会与应用栏重叠,有时文本会显示在图像的右侧,请帮助我。
我想要显示 RecyclerView 的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_meme_bazar"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_meme_bazar"
app:menu="@menu/activity_meme_bazar_drawer" />
</android.support.v4.widget.DrawerLayout>
<!--Where to add this recycler view????-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
【问题讨论】:
标签: android android-recyclerview android-cardview android-appbarlayout