How to fit Image into ImageView using Glide

后端 未结 6 580
走了就别回头了
走了就别回头了 2021-01-31 02:20

My concern is how to fit image using android:scaleType=\"fitXY\" into image using Glide.

My ImageView is

<         


        
6条回答
  •  猫巷女王i
    2021-01-31 03:09

    You can call .override(horizontalSize, verticalSize). This will resize the image before displaying it in the ImageView.

    Glide.with(context)
         .load(url)
         .override(horizontalSize, verticalSize)//resizes the image to these dimensions (in pixel).
         .into(img);
    

提交回复
热议问题