RecyclerView在工具栏下方

朱比康

问题:我在中有一个RecyclerViewToolbar一个CoordinatorLayoutRecyclerView低于Toolbar但它不应该。

在此处输入图片说明

问题:我如何才能实现RecyclerViewToolbar有一个边界?

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar">

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

    </android.support.design.widget.AppBarLayout>

    <FrameLayout
        android:id="@+id/maschinelistcontainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</android.support.design.widget.CoordinatorLayout>

machine_fragment.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:scrollbars="vertical" />

</LinearLayout>
梅尔达德·科斯拉维(Mehrdad khosravi)

将您的代码更改为此:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar">

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

    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior = "@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>

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

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

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

工具栏下方的白条

来自分类Dev

工具栏下方的AppBarLayout滚动内容

来自分类Dev

在工具栏下方添加片段

来自分类Dev

如何使DrawerLayout显示在工具栏下方?

来自分类Dev

在工具栏下方添加片段

来自分类Dev

工具栏在状态栏下方重叠

来自分类Dev

CoordinatorLayout中工具栏下方的进度栏

来自分类Dev

Recyclerview + viewpager,使工具栏折叠

来自分类Dev

工具栏未与嵌套的RecyclerView合并

来自分类Dev

Recyclerview + viewpager,使工具栏折叠

来自分类Dev

未找到 RecyclerView 和工具栏

来自分类Dev

如何在工具栏下方设置NavitagionView?

来自分类Dev

如何在外部/下方工具栏显示SearchView

来自分类Dev

如何将导航抽屉放在工具栏下方?

来自分类Dev

将框架布局放置在ConstraintLayout的工具栏下方

来自分类Dev

如何在Android工具栏下方启动抽屉布局?

来自分类Dev

如何消除工具栏和下方布局之间的间隙

来自分类Dev

无法将我的 TextView 放在工具栏下方

来自分类Dev

出现在工具栏下方的 Android ListView

来自分类Dev

网站内容位于工具栏旁边而不是下方

来自分类Dev

当RecyclerView为空时,阻止工具栏崩溃

来自分类Dev

使用折叠的工具栏布局实现RecyclerView

来自分类Dev

具有SearchView临时过滤RecyclerView的工具栏

来自分类Dev

Recyclerview中的Cardview与折叠的工具栏重叠

来自分类Dev

滚动RecyclerView时隐藏工具栏时的布局抖动

来自分类Dev

无法滚动 RecyclerView,尝试在滚动时隐藏工具栏

来自分类Dev

如何将溢出菜单放置在工具栏下方而不是溢出菜单与应用栏重叠

来自分类Dev

删除空白活动中动作栏下方的阴影工具栏

来自分类Dev

工具栏盲区

Related 相关文章

热门标签

归档