Although RecyclerView has a very good and smooth scrolling built-in, but when you put into any ScrollView, then your RecyclerView’s scrolling will not work. For example, <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <android.support.v7.widget.RecyclerView android:id="@+id/listRecyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="@dimen/_10sdp" tools:listitem="@layout/activity_type_item_layout"/> </LinearLayout> </ScrollView> Now, the RecyclerView will not scroll. To fix that, you will have to use NestedScrollView instead of ScrollView like this: <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <android.support.v7.widget.RecyclerView android:id="@+id/listRecyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="@dimen/_10sdp" tools:listitem="@layout/activity_type_item_layout"/> </LinearLayout> </android.

Continue reading

Author's picture

Wajahat Karim

Android Developer. Open Source Contributor. Writer. Speaker

Senior Android Developer

Karachi, Pakistan