带透明度的FloatingActionButton背景提示

4

我在我的应用程序中放置了一个fab。

我使用不透明度(#44FF0000)设置了背景提示(backgroundHint)。

但是里面有一个小圆圈。

fab图片

我该如何移除这个小圆圈?

这是我的代码:

<android.support.design.widget.FloatingActionButton
    android:id="@+id/close"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center_horizontal"
    android:layout_marginBottom="70dp"
    android:layout_marginRight="80dp"
    android:src="@drawable/phone"
    app:backgroundTint="#44FF0000" />

谢谢


1
你不能移除“这个小圆圈”。阴影是在背景下绘制的。使用任何投射阴影的东西都要使用实心背景。案子结束了。 - Eugen Pechanec
1个回答

3

您无法移除“这个小圆圈”。它是由于阴影被绘制在背景下方所造成的。

备选方案a)

对于任何产生阴影的物体,使用实心背景。

备选方案b)

不要在半透明的小部件上使用阴影/高程。对于FAB:

<...FloatingActionButton
    app:elevation="0dp"
    app:pressedTranslationZ="0dp"/>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接