我正在尝试将FloatingActionButton的波纹效果设置为类似于Material Design中这个的样式。
问题是,我只得到一个“扁平风格”,其中没有波纹,它只是将按钮从白色(在我的情况下)变为橙色,而没有上面链接中显示的动画效果。
我已经按照这里的答案进行了操作:
FloatingActionButton example with Support Library
但是我的FAB仍然很无聊!
编辑: 我的当前代码是: XML:
<android.support.design.widget.FloatingActionButton
android:id="@+id/item_activity_fab"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginRight="16dp"
android:src="@drawable/watch"
app:borderWidth="0dp"
app:elevation="6dp"
app:fabSize="normal"
app:layout_anchor="@id/item_activity_title_background"
app:layout_anchorGravity="top|right|end"
app:pressedTranslationZ="12dp"
app:rippleColor="@android:color/transparent"/>
Java:
mAddToWatchListFAB.setRippleColor(ContextCompat.getColor(this, R.color.orange_6));
我在浮动操作按钮上尝试了那种方法,但似乎没有起作用。我还尝试了我提供的链接中的步骤。