有没有办法通过 XML 属性设置浮动操作按钮的波纹颜色?

Is there a way to set the ripple color for a Floating Action Button through XML Attributes?

我看到有一个 setRippleColor 方法,但我想知道是否可以避免以编程方式更改浮动操作按钮的颜色。感谢您的帮助!

您正在寻找 app:rippleColor

使用这个app:rippleColor="@color/your_ripple_color"

您可能还需要设置可点击。

app:rippleColor="@color/colorPrimaryDark"
android:clickable="true"