I have an xml,NestedScrollView with constraintlayout as child layout. scroll is not working.I tried setting fillviewport as true, still its not working. Constraint layout only with recyclerview is working as expected. But if I tried using NestedScrollView with Constraint layout, scroll is not working.
Requirement is the whole page should scroll. Can someone help me?
Here is my xml
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rlayout_generic"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/view_background"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="@drawable/background_gradient"
android:padding="@dimen/content_edge_margin_horizontal"
app:layout_constraintBottom_toBottomOf="@+id/textview_wallet_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textview_wallet_total_price" />
<TextView
android:id="@+id/textview_wallet_total_price"
style="@style/Regular.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_edge_margin_horizontal"
android:paddingTop="@dimen/content_edge_margin_horizontal"
android:layout_marginEnd="@dimen/content_edge_margin_horizontal"
android:textColor="@color/color_white"
android:text="₹ 0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/textview_wallet_title"
style="@style/Regular.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_edge_margin_horizontal"
android:layout_marginEnd="@dimen/content_edge_margin_horizontal"
android:paddingBottom="@dimen/content_edge_margin_horizontal"
android:text="@string/lbl_wallet_tilte"
android:textColor="@color/color_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_wallet_total_price" />
<TextView
android:id="@+id/textview_transaction_title"
style="@style/Regular.Subheading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/content_edge_margin_horizontal"
android:lines="1"
android:layout_marginStart="@dimen/content_edge_margin_horizontal"
android:layout_marginEnd="@dimen/content_edge_margin_horizontal"
android:text="@string/lbl_transaction_history"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_wallet_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_wallet"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="@dimen/content_edge_margin_horizontal"
app:layout_constrainedHeight="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_transaction_title" />
<ProgressBar
android:id="@+id/progressbar_wallet_history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/textview_transaction_title"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>