Scale an image up to fill entire ImageView in Android

后端 未结 4 569
天命终不由人
天命终不由人 2021-01-31 07:16

I\'d like to scale an image up to take up the entire size of an ImageView. This is subtly different than using scaleType=fit_center because fit_center will leave b

4条回答
  •  我在风中等你
    2021-01-31 07:34

    You can use android:scaleType="centerCrop". Keeps the aspect ratio and scales the image just like you want it.

    For more information please go through the below link

    http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType

提交回复
热议问题