Search code examples
androidfloating-action-button

How to resize icon inside fab button


I have a fab button that I would like to make smaller. I am using fabCustomSize to achieve this:

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:fabCustomSize="24dp"
    android:src="@drawable/ic_add_black_24dp" />

However, I really want the icon to smaller than 24dp as my button is 24dp.

I do realize that an easy answer probably adds a smaller icon to my app, however, I already have the 24dp icon, is there a way to make 24dp icon smaller?


Solution

  • You can try to use app:maxImageSize="your_image_max_size"

    Hope this helps.