I'm wrapping 2 headers and 2 RecycleView with ScrollView so that my screen can scroll if the item overflow. Each RecycleView can only contain 3 item.
This is what I'm trying to achieve
But what I get is the second RecycleView at the bottom, can only show one item. And I don't know why.
This is my XML layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite"
tools:context="com.udaily.udaily.view.fragment.NewsFragment">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:weightSum="100">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:adjustViewBounds="false"
android:scaleType="fitCenter"
android:src="@drawable/infonitas" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="30"
android:gravity="center_vertical">
<Spinner
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginLeft="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="30"
android:gravity="center_vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center_vertical"
android:text="Lihat Semua >>>"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/newsInfonitas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingRight="20dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:weightSum="100">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:adjustViewBounds="false"
android:scaleType="fitCenter"
android:src="@drawable/indochinatown" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="30"
android:gravity="center_vertical">
<Spinner
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="30"
android:gravity="center_vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center_vertical"
android:text="Lihat Semua >>>"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/newsIndoChina"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingRight="20dp" />
</LinearLayout>
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.constraint.ConstraintLayout>
Can someone guide how to show full content at the second RecycleView