如何消除MaterialCardVew的波纹效应? [英] How to remove ripple effect from MaterialCardVew?
本文介绍了如何消除MaterialCardVew的波纹效应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何禁用 MaterialCardView
的触摸波纹效果?将 clickable
属性设置为 false
或使用 foreground
和 background
属性无效.
How can I disable touch ripple effect of MaterialCardView
?
Setting clickable
attribute to false
or playing with foreground
and background
attributes had no effect.
我正在使用材料支持库版本 1.1.0-alpha02 .
I'm using material support library version 1.1.0-alpha02.
推荐答案
只有 rippleColor
是可样式化的
:
<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>
这篇关于如何消除MaterialCardVew的波纹效应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文