我有一个RecyclerView,其中包含带有ScrollView的CardView。但CardView不响应点击。当我删除ScrollView它完美的工作。有没有什么方法可以使ScrollView响应点击?可滚动CardView无法响应点击
我的CardView看起来像这样;
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
card_view:cardUseCompatPadding="true">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>
在另一个可滚动视图(recyclerview)中有scrollview会导致这样的问题。 –
@Santosh请点击代码或参考coderzpassion.com教程。您应该使用NestedScrollView而不是ScrollView –