How to fit Image into ImageView using Glide

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

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

My ImageView is

<         


        
6条回答
  •  春和景丽
    2021-01-31 03:07

    On Glide v4 you have to create a RequestOptions object, like this:

    RequestOptions options = new RequestOptions();
    options.centerCrop();
    
    Glide.with(fragment)
        .load(url)
        .apply(options)
        .into(imageView);
    

    More info

提交回复
热议问题