简体   繁体   中英

Alpha applied to floating action button creates weird circle?

In my app I am using a material design floating action button. Whenever I change the backgroundTintColor property of the button to something with an alpha below 255, it creates this strange circle within the button. I have provided a picture of the button below with my xml code... Any help would be greatly appreciated.

在此处输入图片说明

    <FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right|end"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="55dp"
        android:layout_height="55dp"
        android:clickable="true"
        android:layout_margin="12dp"
        android:src="@drawable/ic_play"
        app:backgroundTint="#64a9a9a9"
        android:layout_gravity="center"
        />

</FrameLayout>

这很可能是因为背景用于创建shadowelevation和 src 来显示fab的主要内容,但您正在更改它,请查看fab https://android.googlesource.com/platform/frameworks/support 的源代码/+/master/design/src/android/support/design/widget/FloatingActionButton.java?autodive=0%2F%2F

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM