NineGridLayout icon indicating copy to clipboard operation
NineGridLayout copied to clipboard

Bug:RecyclerView重用item导致图片不显示

Open dwordwu opened this issue 9 years ago • 7 comments

dwordwu avatar Jul 08 '16 09:07 dwordwu

RecyclerView重用item导致图片不显示,我也遇到了同样的问题,经过debug之后发现mTotalWidth = right - left;right和left总是相等

yndongyong avatar Jul 20 '16 16:07 yndongyong

恩,RecyclerView 复用导致图片不显示。。但是我这边并没有mTotalWidth=0的问题,还在定位中。。

ahjsrhj avatar Aug 02 '16 09:08 ahjsrhj

我测了,RecyclerView重用没得问题呀。测试代码已提交,你们看看呢

HMY314 avatar Aug 06 '16 08:08 HMY314

我这边的处理就是在创建 view 的时候直接拿到的屏幕宽度当做 totalWidth, 在 onLayout 调用的时候可能会出现 mTotalWidth 为0的情况。。。

ahjsrhj avatar Aug 08 '16 07:08 ahjsrhj

贴出你的关键代码看一下

HMY314 avatar Aug 08 '16 12:08 HMY314

遇到RecyclerView+Glide导致某些item(这个item只是一个LinearLayout内部嵌套一个RatioImageView)的图片不显示的问题。如果把RatioImageView的onTouch注释掉是没问题的。bug还没定位到。。

Jermmy avatar Oct 12 '16 16:10 Jermmy

问题解决了,bug在于Glide会将TransitionDrawable替换为GlideBitmapDrawable。在测试的时候发现,那些点击后消失的ImageView内部都是TransitionDrawable,而正常的则是GlideBitmapDrawable。解决办法:https://github.com/bumptech/glide/issues/670

Jermmy avatar Oct 13 '16 07:10 Jermmy