点击后立即启动Android Card View涟漪效果

时间:2016-04-15 19:51:24

标签: android android-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:layout_width="match_parent"
android:layout_height="170dp"
android:layout_margin="5dp"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="horizontal"
card_view:cardBackgroundColor="@android:color/white"
card_view:cardCornerRadius="5dp"

card_view:cardUseCompatPadding="true">

点击卡片后,似乎涟漪效果就开始了。 所以涟漪效应大部分发生在我点击卡片以便滚动它。这是一种烦人的行为。

有没有一种方法可以“延迟”涟漪效应或仅在真正的点击时发生,而不是在滚动上发生?

1 个答案:

答案 0 :(得分:2)

在卡片视图中设置android:clickable="true"

相关问题