Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why recyclerview use Glide,the image didnt display.Piccaso working good. #851

Closed
wozuihighwa opened this issue Dec 30, 2015 · 2 comments
Closed
Labels

Comments

@wozuihighwa
Copy link

I try to set the width,height and scaleType properties of ImageView(fitcenter,centercrop),but also didnt work. Piccaso working good.

here's some code:

Glide.with(context).load(photoUrls.get(position)).into(holder.imageView);
Picasso.with(context).load(photoUrls.get(position)).into(holder.imageView);

xml:

    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scaleType="fitCenter"
@TWiStErRob
Copy link
Collaborator

Wrap causes the ImageView to have size 1080x0 size on first layout (because there's no src/drawable yet) which is then used by Glide to load a Bitmap of that size, which obviously is a pointless load. See #135 for more: try not to use wrap_content or use .override(). Note that .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) will be no different than what Picasso does (as far as I remember), wasting memory. Try to give a number for at least one dimension to save resources (e.g. screenwidth/2 for a 2-column grid).

@wozuihighwa
Copy link
Author

It's helpful,thx. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants