AnimShopButton icon indicating copy to clipboard operation
AnimShopButton copied to clipboard

在recyclerview中重新刷新数据时setCount数量不变或是错乱

Open KXwonderful opened this issue 8 years ago • 3 comments

首页界面viewpager中有3个fragment,fragment中用recyclerView显示商品列表,当在购物车编辑购买数量后用 EventBus 通知首页刷新商品列表,打log发现数据有改变,但 AnimShopButton中的数量确没变化,一开始还以为是 notifyDataSetChanged() 无效,但测试发现界面刷新了,但 AnimShopButton 数量还是没改变。

之前还碰到过,在商品列表中添加或减少购买数量,其他商品的 AnimShopButton 数量跟着改变,数字错乱

KXwonderful avatar Jun 08 '17 08:06 KXwonderful

刚试了下,在 setCount() 方法中加入 invalidate() 可以解决不刷新的问题,但不知道会不会影响其他的

KXwonderful avatar Jun 08 '17 08:06 KXwonderful

没遇到过这个问题诶,挂在这里给其他人一个参考吧。

mcxtzhang avatar Jul 14 '17 02:07 mcxtzhang

遇到楼上的问题

stormlei avatar May 03 '18 07:05 stormlei