2017-10-09 8 views
0

私は、情報ビューを上部に表示し、ページャの下部に2つのタブを表示する必要があるという要件があります。 View pagerにはRecycler Viewのタブが2つあります。スティッキースクロールビュー内でRecyclerビューを使用すると動作しない

ユーザーがスクロールアップし、その内部のリサイクラビューがスクロールを開始するときは常に、表示ページャがスティックされます。これを達成するために、上部と下部に2つの別々のフラグメントを作成し、このように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> 

これは2つのタブがあり、それぞれが、この内部リサイクル・ビューを有しています。これを実行すると、親スクロールビューは機能しなくなり、recyclerviewスクロールだけが機能します。

答えて

0

xmlのrecyclerviewにandroid:nestedScrollingEnabled="false"を追加してみてください。

+0

すでに試してみました...リサイクラビューを固定しているだけです。画面全体がスクロールを停止する – Ashim

関連する問題