0

I am using NestedScrollView in tab layout and when I implemented RecyclerView in NestedScrollView 2 problems occur:

  1. Toolbar is not hiding.
  2. RecyclerView in not scrolling smoothly.

Here is my Code:

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:fillViewport="true" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="match_parent" android:background="#fff" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_below="@+id/toolbar" android:id="@+id/recyclerView" android:background="#fafafa" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" /> <ProgressBar android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" /> </RelativeLayout> </android.support.v4.widget.NestedScrollView> 
1
  • do you have toolbar in NestedScrollView because as per your code you add your RecyclerView with android:layout_below="@+id/toolbar" Commented Apr 26, 2017 at 18:20

2 Answers 2

1

use recylerView.setNestedScrollingEnabled(false); to make your scrolling smoother.

Sign up to request clarification or add additional context in comments.

Comments

0

Create separate layout files for views and try. And include those into the list view.

<LinuearLayout ..> <include layout="@layout/cv1"/> <include layout="@layout/rv1"/> <include layout="@layout/rv2"/> <include layout="@layout/rv3"/> </LinearLayout> 

This is just a clue to you. I did solve similar issues long back in past. Please try experimenting with this clue.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.