2017-10-09 96 views
0

我有一个需求,我需要编写一个屏幕,其中顶部有一个信息视图,并在底部有两个选项卡查看寻呼机。查看传呼机有两个带Recycler View的标签。在粘滞滚动视图中使用Recycler视图不工作

无论何时用户向上滚动查看传呼机,然后里面的回收站视图都应该开始滚动。为了达到这个目的,我为顶部和底部创建了两个单独的片段,并像这样写了xml。

<com.citi.mobile.dashboard.views.StickyScrollView 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:custom="http://schemas.android.com/apk/res-auto" 
android:orientation="vertical" 
android:fillViewport="true" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/core_color_FFFFFF_white"> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 
    <include 
     android:id="@+id/title_id" 
     layout="@layout/app_bar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

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


    <FrameLayout 
     android:id="@+id/bottom_container" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:tag="sticky"> 
    </FrameLayout> 

</LinearLayout> 

里面的底部容器我有一个观点寻呼机。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:custom="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:gravity="center_horizontal" 
android:orientation="vertical"> 

<android.support.design.widget.TabLayout 
    android:id="@+id/TransTabs" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    app:tabGravity="fill" 
    app:tabIndicatorColor="@color/core_color_0077bb_blue" 
    app:tabMode="fixed" 
    app:tabSelectedTextColor="@color/core_color_0077bb_blue" 
    app:tabTextAppearance="@style/ledgerTabLayoutTextAppearance" 
    app:tabTextColor="@color/core_color_666666_grey" 
    custom:typefaceName="Roboto-Medium" /> 

<android.support.v4.view.ViewPager 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/transaction_pager" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 


</android.support.v4.view.ViewPager> 

这具有两个选项卡和每个都具有内侧这个再循环器图。当我运行这个父滚动视图停止工作,只有recyclerview滚动工作。

回答

0

尝试在您的xml中将android:nestedScrollingEnabled="false"添加到recyclerview中。

+0

已经尝试过......它只是使回收视图固定多数民众赞成它。整个屏幕停止滚动 – Ashim

相关问题