-1

I have requirement where i need to have many horizontal RecyclerView It will have interface similar to Google PlayStore. Now the problem is If i add ScrollView in my layout and run app then it shows nothing on screen. When i remove it show RecyclerView

This is XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ScrollView
        android:layout_width="wrap_content"
        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/featured"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10sp"
                android:background="#ECEFF1" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/latest"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10sp" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/startup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10sp" />
        </LinearLayout>
    </ScrollView>

</LinearLayout

How should i solve this problem. I want to add ScrollView to activity which will have 9 to 10 horizontal RecyclerView

Zeeshan Shabbir
  • 6,704
  • 4
  • 38
  • 74
  • i think you should use NestedScrollView instead of ScrollView http://developer.android.com/intl/vi/reference/android/support/v4/widget/NestedScrollView.html see http://stackoverflow.com/questions/27083091/recyclerview-inside-scrollview-is-not-working – vuhung3990 Feb 02 '16 at 07:51
  • Thank for the suguestion and link. – Zeeshan Shabbir Feb 02 '16 at 07:55

1 Answers1

0

Set the height of the Recyclerviews to an actual dp value

gilokimu
  • 531
  • 4
  • 10