Android 如何使用recyclerview滚动滚动工具栏和其他视图

Android 如何使用recyclerview滚动滚动工具栏和其他视图,android,android-recyclerview,android-toolbar,Android,Android Recyclerview,Android Toolbar,我想实现与应用程序产品列表中相同的滚动效果 例如,以下是图像 滚动前的图像 滚动后的图像 我已经关注了这些链接 他们都帮不了我 以下是我的活动容器和产品列表布局的代码 <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

我想实现与应用程序产品列表中相同的滚动效果 例如,以下是图像
滚动前的图像



滚动后的图像

我已经关注了这些链接




他们都帮不了我

以下是我的活动容器和产品列表布局的代码

   <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            android:fitsSystemWindows="true">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

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

        <FrameLayout
            android:id="@+id/activity_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_width="match_parent"
            android:layout_height="match_parent"></FrameLayout>

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


    <android.support.design.widget.NavigationView
        android:id="@+id/navigationView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>

productlist.xml

<?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:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/category_name"
            android:layout_width="wrap_content"
            android:layout_height="30dp"
            android:layout_gravity="center"
            android:textColor="@color/black"
            android:layout_marginTop="5dp"
            android:textSize="15sp"
            android:textStyle="bold" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:background="#D8D8D8"
            android:orientation="horizontal"
            android:weightSum="5">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter1"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter2"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter3"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter4"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter5"
                android:textColor="@android:color/black" />
        </LinearLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="#E8E8E8">

            <TextView
                android:id="@+id/prdct_count"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_marginStart="20dp"
                android:layout_marginTop="15dp"
                android:textColor="@android:color/black"
                android:textSize="15sp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_marginEnd="15dp"
                android:layout_marginTop="3dp"
                android:drawablePadding="2dp"
                android:drawableTop="@drawable/filter"
                android:text="@string/filter"
                android:textColor="#404040"
                android:textSize="15sp" />
        </RelativeLayout>


        <android.support.v7.widget.RecyclerView
            android:id="@+id/subscriptList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="vertical"
            android:visibility="visible"></android.support.v7.widget.RecyclerView>
    </LinearLayout>


    <TextView
        android:id="@+id/empty_list_msg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_vertical"
        android:textColor="@android:color/black"
        android:textSize="20sp"
        android:visibility="gone" />
</LinearLayout>


试试这个@NileshRathod我不需要折叠工具栏你明白了吗?我也必须实现这一点。试试这个@NileshRathod我不需要折叠工具栏你明白了吗?我也必须实施这一点。