0

I need to know if there are any way to combine both Views (ListView and LinearLayout(for example)) with the pourpose to scroll both of them. I know that i can use a ScrollView, but i dont know how to put the ListView with the max Size...

The thing that i want to do is something like Samsung Music have, a Scrolling View that have a GridLayout at the top, and a ListView at the bottom, and when de user scrolls the view the gridLayout and Listview scrolls together.

Sorry for my bad english... and Thanks so much.

1 Answers1

0

use nestedscrollview for that purpose make your layout look like this

        <android.support.v4.widget.NestedScrollView
        android:id="@+id/nestedScrollingView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

             **// add here all  your controll like this**


            <ImageView/>

            <LinearLayout>

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

            </LinearLayout>

        </LinearLayout>

    </android.support.v4.widget.NestedScrollView>

make RecyclerView.setNestedScrollingEnabled(false); to your recyclerview

AskNilesh
  • 67,701
  • 16
  • 123
  • 163