Icon not appearing on fab

I have a fab(floating action button), here is it’s XML code

<android.support.design.widget.FloatingActionButton
        android:id="@+id/floatingActionButton3"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginEnd="28dp"
        android:layout_marginTop="32dp"
        android:clickable="true"
        android:focusable="true"
        app:backgroundTint="@color/vert"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_check_circle_black_18dp" />

As you can see in the code I want the icon “ic_check_circle_black_18dp” to be on my fab. When I click on “design” I can see the icon on my button, but when I launch my app on my phone (7.1) there are no icons.

I already checked the following questions : AppCompat 23.2 use VectorDrawableCompat with RemoteViews (AppWidget) on API<21

Why is my floating action button not displaying its image properly?

I can’t find any solution to my problem

Answer

Well, i avoided the problem by using ImageButton instead of Floating action button and it works.

Leave a Reply

Your email address will not be published. Required fields are marked *