来自 github 个集成问题的 FAB

FAB from github integration issues

由于这个问题>

我决定使用这个资源 > https://github.com/Clans/FloatingActionButton

但是当我把它放在我的布局中时出现了2个问题,

  1. Black background around the FAB
  2. Redline around the FAB circle.

:

我该如何解决这个问题?

FAB 在 xml

 <com.github.clans.fab.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_gravity="bottom|start"
        android:layout_marginBottom="16dp"
        android:layout_marginRight="16dp"
        android:src="@drawable/smiley"
        android:layout_margin="@dimen/fab_margin"
        android:backgroundTint="@android:color/transparent"/>

而不是使用 android:backgroundTint="@android:color/transparent" 使用 fab:fab_colorNormal="@color/app_primary".

 <com.github.clans.fab.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_marginBottom="8dp"
        android:layout_marginRight="8dp"
        android:src="@drawable/ic_menu"
        fab:fab_colorNormal="@color/app_primary"
        fab:fab_colorPressed="@color/app_primary_pressed"
        fab:fab_colorRipple="@color/app_ripple"/>

希望对你有所帮助