0

How to use RecyclerView inside NestedScrollView? RecyclerView content is not visible after setting adapter.

Anyway, I have already tried with RecyclerView inside NestedScrollView by adding a viewgroup like framelayout or relativelayout as a single child of nestedscrollview and then I added a recyclerview inside framelayout or relativelayout)

Thanks in Advance...

<android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/colorWhite">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v4.widget.NestedScrollView
                android:id="@+id/nestedView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/appbar"
                android:fillViewport="true"                                   
               app:layout_behavior="@string/appbar_scrolling_view_behavior">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/profile_bg_clound"
                    android:orientation="vertical">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="5dp"
                        android:layout_marginLeft="15dp"
                        android:layout_marginRight="15dp"
                        android:layout_marginTop="5dp">

                        <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
                            android:id="@+id/swipe_refresh_layout"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content">


                            <android.support.v7.widget.RecyclerView
                                android:id="@+id/rv_driverRequests"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:orientation="horizontal"
                                app:layout_behavior="@string/appbar_scrolling_view_behavior" />

                        </android.support.v4.widget.SwipeRefreshLayout>


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



        </RelativeLayout>


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

1 Answers1

-2

Replace your RecycleView with this...

<com.app.view.CustomRecyclerView
        android:id="@+id/rv_driverRequests"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

Hope this will work.

Monim Kaiser
  • 65
  • 1
  • 2
  • 7