Search code examples
androidxmlandroid-widgetfloating-action-button

How to set image to center crop in Floating Action Button


I wanted to put user Profile Image inside the FAB but its size appearing on it is real small, how to center crop it..

 <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab_blurrhgrh"
        android:visibility="visible"
        android:layout_marginStart="6dp"
        android:layout_gravity="center|start"
        app:backgroundTint="@color/white"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        android:src="@drawable/dev_pic_crop"
      android:adjustViewBounds="true"
         android:scaleType="centerCrop"
        android:layout_alignParentEnd="true"/>

Solution

  • I found the answer,

    app:maxImageSize="64dp"