Reputation: 331
I have two recycler view inside bottomsheet, one is horizontal and other one is vertical. I am able to scroll horizontally but not able to scroll vertically in second recycler view. Is there any way to do vertical scroll?
Upvotes: 0
Views: 696
Reputation: 420
This is work for me use NestedScrollview in xml Like that
<android.support.v4.widget.NestedScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerViewFeaturedLoc"
android:layout_below="@+id/recyclerViewHorizontal"
android:paddingTop="@dimen/activity_vertical_margin"
/>
<ProgressBar
android:layout_centerInParent="true"
android:id="@+id/home_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Then set vertical scroll view in java file like that
recyclerViewFeaturedLoc.setNestedScrollingEnabled(false);
Upvotes: 1