Xml 将ConstraintLayout作为子项的NestedScrollView不工作,
我有一个xml嵌套的ScrollView,子布局是constraintlayout。滚动不起作用。我尝试将fillviewport设置为true,但仍然不起作用。仅使用recyclerview的约束布局按预期工作。但如果我尝试将NestedScrollView与约束布局一起使用,则scroll不起作用 要求是整个页面应该滚动。 有人能帮我吗 这是我的xmlXml 将ConstraintLayout作为子项的NestedScrollView不工作,,xml,android-layout,android-constraintlayout,android-nestedscrollview,Xml,Android Layout,Android Constraintlayout,Android Nestedscrollview,我有一个xml嵌套的ScrollView,子布局是constraintlayout。滚动不起作用。我尝试将fillviewport设置为true,但仍然不起作用。仅使用recyclerview的约束布局按预期工作。但如果我尝试将NestedScrollView与约束布局一起使用,则scroll不起作用 要求是整个页面应该滚动。 有人能帮我吗 这是我的xml <androidx.core.widget.NestedScrollView xmlns:android="http://s
<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>
设置ScrollView(ConstraintLayout)子级的高度以包装内容。我尝试过,但结果相同。滚动不会发生:将RelativeLayout或ConstraintLayout作为根布局,并将嵌套的ScrollView放在下面。