0

I want to know is it possible to scroll recyclerview and scroll other object without using nested scroll or scrollview?

<LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical">
  <TextView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="50dp"
    android:layout_gravity="center"
    android:gravity="center"
    android:text="Text or other oject will list here"
    android:id="@+id/info"/>
  <android.support.v7.widget.RecyclerView
    android:id="@+id/business_recycle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
</LinearLayout>

1 Answers1

2
<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

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

        <TextView
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_marginTop="50dp"
             android:layout_gravity="center"
             android:gravity="center"
             android:text="Text or other oject will list here"
             android:id="@+id/info"/>

        <android.support.v7.widget.RecyclerView
             android:id="@+id/business_recycle"
             android:layout_width="match_parent"
             android:layout_height="wrap_content" />
    </LinearLayout>
</android.support.v4.widget.NestedScrollView>

Note: set recyclerView.setNestedScrollingEnabled(false); programmatically

A. Badakhshan
  • 1,045
  • 7
  • 22
Rajesh
  • 2,618
  • 19
  • 25