如何禁用 MaterialCardView
的触摸波纹效果?
设置clickable
归属于 false
或玩foreground
和 background
属性没有影响。
我正在使用 Material 支持库版本 1.1.0-alpha02 .
最佳答案
只有 rippleColor
是 styleable
:
<com.google.android.material.card.MaterialCardView
style="@style/Widget.MaterialComponents.CardView"
app:rippleColor="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.google.android.material.card.MaterialCardView>
备注 : 它不会消除 <androidx.cardview.widget.CardView
中的涟漪效应尽管。
关于java - 如何从 MaterialCardView 中移除涟漪效应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54136501/