0

I added NestedScrollView into my fragment as following code snippet.

I'm using FragmentPagerAdapter to display fragment content in ViewPager. (following this article)

Content is populating properly but I'm not able to scroll.

main_fragment.xml

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:weightSum="1"
        android:background="@color/feed_grey_background" >

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/default_gap_1_5x">
        </LinearLayout>

        <android.support.design.widget.TabLayout
            android:id="@+id/sliding_tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabMode="fixed" />

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="@android:color/holo_blue_light" />

    </LinearLayout>
</android.support.v4.widget.NestedScrollView>

tabview_fragment.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/postList"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

update

I'm able to scroll recycler view (not nestedscrollview) if I remove recyclerView.setNestedScrollingEnabled(false);

Piyush
  • 1,528
  • 2
  • 24
  • 39

0 Answers0