Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image appears stretched after loading Placeholder image via Glide?

I am trying to use Glide to load a few images in a Listview. The image loads correctly if I don't use a placeholder while loading the image. However, when I attempt to set a placeholder, the image that I am loading from over the network appears stretched. This only occurs in instances where the placeholder image is used. If I were to leave the screen and return (so that no placeholder image is loaded) the image then appears correctly.

Here is my simple Glide implementation:

Glide.with(context)
                .load(url)
                .placeholder(R.drawable.empty_logo)
                .error(R.drawable.error)
                .into(imageView);
like image 428
Andre Perkins Avatar asked Dec 07 '22 23:12

Andre Perkins


1 Answers

I know I'm answering pretty late, but this is how it helped me:

Glide.with(context).load(url).placeholder(R.drawable.empty_logo).dontAnimate().into(imageView);

Use dontAnimate(), it worked for me. Hope it helped :)

like image 73
Abhi Avatar answered Apr 27 '23 01:04

Abhi