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

images in recyclerview become smaller and smaller as i pull up the list #1506

Closed
venjee opened this issue Oct 9, 2016 · 5 comments
Closed

Comments

@venjee
Copy link

venjee commented Oct 9, 2016

Glide Version: glide:3.7.0

Integration libraries: volley-integration:1.4.0@aar

Device/Android Version: all android devices

Issue details / Repro steps / Use case background:
I just load images from network,and show them in
recyclerview,and when i pull up the list,the images will become smaller and smaller, i am not sure if this behavior is glide's normal behavior or i did some wrong action.

Glide load line / GlideModule (if any) / list Adapter code (if any):

 Glide.with(fragmentWeakReference.get())
                   .load(data.get(position).getPicUrl())
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .crossFade()
                    .placeholder(R.drawable.placeholder)
                    .into(holder.image);

Layout XML:

recyclerview item layout
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@id/joke_text"
                android:layout_centerHorizontal="true"
                android:id="@+id/joke_img"/>

Stack trace / LogCat:

paste stack trace and/or log here
@venjee venjee changed the title image in recyclerview become smaller and smaller as i pull up the list images in recyclerview become smaller and smaller as i pull up the list Oct 9, 2016
@TWiStErRob
Copy link
Collaborator

Don't use wrap/wrap on the ImageView. Try to refactor your UI to have at least one match or fixed size on the ImageView, the other can be wrap.

@venjee
Copy link
Author

venjee commented Oct 9, 2016

hi @TWiStErRob

thanks for your reply,i change the image view's width to match_parent,however,it seems not work, please check the image

screenshot_20161009-161037 1

@TWiStErRob
Copy link
Collaborator

TWiStErRob commented Oct 10, 2016

No good idea for this. Did you try clearing the cache? Do you have anything in code that messes with the layout params?

@yuansip
Copy link

yuansip commented Nov 17, 2016

@venjee , I suggest you change ImageView's width to match_parent and height to wrap_content, then call holder.image.layout(0, 0, 0, 0) in your_recyclerview_adapter.onBindViewHolder. This help me resolve the issue #1591, which is similar with your issue #1506.

@stale
Copy link

stale bot commented Nov 12, 2017

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@stale stale bot added the stale label Nov 12, 2017
@stale stale bot closed this as completed Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants