我有一個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 –