【发布时间】:2018-10-24 16:38:11
【问题描述】:
我有一个 CardView,其中包含 RecyclerView。当用户单击 RecyclerView 项目时,我尝试在整个 CardView(或整个 RecyclerView)上产生涟漪效应,但涟漪效应仅应用于项目。
<android.support.v7.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackground">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"/>
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
【问题讨论】:
标签: android android-recyclerview ripple