TableLayout中的TabBar在android中与下面的recyclerview一起滚动

TableLayout中的TabBar在android中与下面的recyclerview一起滚动,android,android-recyclerview,Android,Android Recyclerview,我正在使用tablayout,在片段中有recyclerviews。。。问题是tabbar正在使用recyclerview滚动,我希望修复tablayout(它不应该随着recyclerview的滚动滚动),而且它在片段中的listview中工作得很好 下面是我的布局…(主布局) (回收视图布局) 尝试删除此行 app:layout\u behavior=“@string/appbar\u scrolling\u view\u behavior”在TabLayout标签中 <?xml

我正在使用tablayout,在片段中有recyclerviews。。。问题是tabbar正在使用recyclerview滚动,我希望修复tablayout(它不应该随着recyclerview的滚动滚动),而且它在片段中的listview中工作得很好

下面是我的布局…(主布局)


(回收视图布局)


尝试删除此行

app:layout\u behavior=“@string/appbar\u scrolling\u view\u behavior”
在TabLayout标签中

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:fitsSystemWindows="true">

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

    <android.support.v7.widget.Toolbar
        android:id="@+id/drawer_layout_toolbar"
        style="@style/Widget.Styled.ActionBar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:elevation="0dp"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

    <android.support.design.widget.TabLayout
        android:id="@+id/drawer_layout_content_main_tablayout"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:tabGravity="fill"
        app:tabIndicatorColor="#ffffff"
        app:tabMode="fixed"
        app:tabSelectedTextColor="#ffffff"
        app:tabTextColor="@color/white"
        app:tabBackground="@color/colorPrimary"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/drawer_layout_content_main_viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    />

</android.support.design.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView 
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/recyclerview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:clipToPadding="false"
    android:scrollbars="vertical" />
</android.support.v4.widget.SwipeRefreshLayout>