我有一个包含带有ScrollView的CardView的RecyclerView。但是CardView不会对点击做出响应。当我移除ScrollView时,它工作得很好。有没有办法让它对ScrollView的点击做出响应?
我的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>发布于 2016-05-16 16:35:45
你不能把一个滚动视图放在另一个滚动视图中,在这种情况下,默认情况下你的回收器视图是可滚动的,所以当你把另一个滚动视图放入回收器视图中时,滚动冲突就会出现,换句话说,它不支持这种行为。
注意:只有当你知道回收机的高度或者需要计算高度时,你才能在scrollView中使用回收器视图。
https://stackoverflow.com/questions/37249504
复制相似问题