这是我正在使用的FAB com.google.android.material.floatingactionbutton.FloatingActionButton
尝试了backgroundTint无法正常工作,并且android:outlineSpotShadowColor="@color/fabShadowColor"
在API级别28及更高版本上工作。
这是我的FAB代码
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/navHomeBtn"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="@drawable/home_ic"
android:outlineSpotShadowColor="@color/fabShadowColor"
app:fabCustomSize="50dp"
app:fabSize="normal"
app:layout_anchor="@id/bottomNav"
app:maxImageSize="50dp"
app:elevation="6dp"
app:borderWidth="0dp"
app:backgroundTint="@color/fabShadowColor"
app:layout_anchorGravity="fill_vertical|center_horizontal"
app:layout_constraintBottom_toTopOf="@+id/bottomNav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_container"
app:layout_constraintVertical_bias="0.65"
tools:targetApi="p" />