Glide: images in recyclerview become smaller and smaller as i pull up the list

Created on 9 Oct 2016  路  5Comments  路  Source: bumptech/glide

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
question stale

Most helpful comment

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

All 5 comments

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.

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

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

@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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

Ncit picture Ncit  路  3Comments

sant527 picture sant527  路  3Comments

r4m1n picture r4m1n  路  3Comments

FooBarBacon picture FooBarBacon  路  3Comments