RecyclerView within RecyclerView is not scrolling

341 views Asked by At

I have a layout SwipeRefreshLayout as parent and within that I am using RecyclerView within RecyclerView. Inner recyclerview is not scrolling. I have tried multiple solution available on this website but not resolve my problem.

main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

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

and recyclerview item

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>
1

There are 1 answers

0
Elinor On BEST ANSWER

Try

recyclerView.setNestedScrollingEnabled(true)