Adjust icon size of Floating action button (fab)

后端 未结 11 1298
名媛妹妹
名媛妹妹 2020-11-29 17:21

\"Floating The new floating action button should be 56dp x 56dp and the icon inside it should

11条回答
  •  长情又很酷
    2020-11-29 17:58

    As FAB is like ImageView so You can use scaleType attribute to change the icon size likewise ImageView. Default scaleType for a FAB is fitCenter. You can use center and centerInside to make icon small and large respectively.

    All values for scaleType attribute are - center, centerCrop, centerInside, fitCenter, fitEnd, fitStart, fitXY and matrix.

    See https://developer.android.com/reference/android/widget/ImageView.ScaleType.html for more details.

提交回复
热议问题