0
votes

I am a fresh man in using Glide.It is right when I just use like that.

Glide.with(context).load("http://abcdefg...").into(imageView);

My ImageView was match_parent(width) and wrap_content(height).

But when I introduce placeholder() and error(),my picture load from web is very small.Does the reason that placeholder() or error() image change the imageView size caused the problem?

How can I satisfiy these demand?

(1)keep the image width:height ratio doesn't change

(2)keep the image width match_parent

1
and i don't want to crop the picture,I want show the picture entirely.chenjj2048

1 Answers

0
votes

The height and width rules of the Imageview apply to the image that you are setting using glide.

You can make use of these 2 functions.

CenterCrop() is a cropping technique that scales the image so that it fills the requested bounds of the ImageView and then crops the extra. The ImageView will be filled completely, but the entire image might not be displayed.

fitCenter() is a cropping technique that scales the image so that both dimensions are equal to or less than the requested bounds of the ImageView. The image will be displayed completely, but might not fill the entire ImageView.