Android: Floating Button Icon is not centred

I have faced the same problem. the following solution have worked for me

app:fabCustomSize="40dp"

You should set fabCustomSize value like FAB exactly size:

<android.support.design.widget.FloatingActionButton
        android:layout_width="60dp"
        android:layout_height="60dp"
        app:fabCustomSize="60dp"
        android:src="https://codeutility.org/@drawable/plus_icon"
        app:rippleColor="@color/colorPrimaryDark" />

You have to add only app:fabCustomSize="40dp" it’s work for me

Leave a Comment