S
S
sanke462018-01-27 14:38:42
Java
sanke46, 2018-01-27 14:38:42

How to properly pack two RecycleViews in a ScrollView?

How to do it right so that when scrolling down, the top RecycleView (with one picture) goes to the top and then the second RecycleView correctly fulfills its tasks?

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#eee">


    <android.support.v7.widget.RecyclerView
        android:id="@+id/list_sale"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        android:layout_marginTop="10dp"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/list_1"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        android:layout_marginTop="10dp"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>



</LinearLayout>
</ScrollView>

5a6c654de9ade663343895.gif

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2018-01-27
@sanke46

It's not clear from the gif. You can try NestedScrollView.

Y
Yuri, 2018-01-30
@YuryBorodkin

in recyclers make nestedSrollingEnabled = "false"
and you should use NestedRecyclerView for such things;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question