I have a ScrollView with a LinearLayout, and several different RecyclerView inside because I load data from different sources.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/posts_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="10dp"
android:layout_marginTop="20dp"
android:nestedScrollingEnabled="false"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/movies_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="10dp"
android:layout_marginTop="20dp"
android:nestedScrollingEnabled="false"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/tv_shows_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="10dp"
android:layout_marginTop="20dp"
android:nestedScrollingEnabled="false"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/music_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="10dp"
android:layout_marginTop="20dp"
android:nestedScrollingEnabled="false"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/books_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="10dp"
android:layout_marginTop="20dp"
android:nestedScrollingEnabled="false"/>
</LinearLayout>
I use both LinearLayoutManager and GridLayoutManager to organise the content showed by the recyclerviews.
GridLayoutManager layoutManager = new GridLayoutManager(context, 2);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
For some reason, the last element of the second RecycleView (with a GridLayout) is getting cut off.
While elements of the other RecycleViews are showed in the correct way.
I don't know if it is important, but inside the RecycleViews I use CardViews.
Any help would be greatly appreciated since I am going nuts with this problem :(
SOLUTION