Answers for "vector icon color always black"

0

vector icon color always black

you are trying to add a icon that has different colours to a FAB?
When doing that, make sure you add app:tint="@null". In your case the xml should look like this:

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
    android:id="@+id/floating_btn_take_test"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    android:layout_marginBottom="@dimen/dimen_20dp"
    android:text="@string/txt_take_test"
    android:textColor="@color/primaryColor"
    app:backgroundTint="@color/color_white"
    app:elevation="@dimen/dimen_10dp"
    app:icon="@drawable/ic_color_icon"
    app:layout_anchorGravity="bottom|center"
    app:rippleColor="@color/secondaryColor"
    app:shapeAppearanceOverlay="@style/ShapeAppearance_Button"
    app:tint="@null" />
Posted by: Guest on December-12-2020

Browse Popular Code Answers by Language