2

I have added RecyclerView in NestedScrollView like this

<android.support.v4.widget.NestedScrollView android:id="@+id/scroll" android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <android.support.v7.widget.RecyclerView android:id="@+id/rv" android:layout_width="match_parent" android:layout_height="match_parent" /> </android.support.v4.widget.NestedScrollView> 

And in Java code I have specified the height like this

recyclerView.setNestedScrollingEnabled(false); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(new DataManager()); recyclerView.setHasFixedSize(true); recyclerView.setMinimumHeight(3000); 

Can anyone tell me what height should I pass so that RecyclerView work properly?

5
  • 1
    why do you wrap your recycler view in a nestedscrollview? Commented Dec 9, 2015 at 12:10
  • 1
    Very bad idea to wrap recycler view in a scroll view Commented Dec 9, 2015 at 12:11
  • Please suggest what should I do to solve this? Commented Dec 9, 2015 at 12:18
  • @DhavalGulhane, if RecyclerView is the only child you have inside NestedScrollView, then replace NestedScrollView with linearlayout Commented Dec 9, 2015 at 12:19
  • Is it for toolbar hide/show? Commented Dec 9, 2015 at 12:35

1 Answer 1

1

Try this.

Here setMinimumHeight(height) is used where height is calculated dynamically.

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

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.