Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

使用StaggeredGridLayoutHelper 进行瀑布流时,发现切换数据会导致新数据的item位置错乱问题 #526

Open
wuliKingQin opened this issue May 22, 2021 · 0 comments

Comments

@wuliKingQin
Copy link

经过研究发现,每次切换数据的时候,发现mLazySpanLookup里面保存的span位置信息还是之前的,所以造成重新填充新的数据的时候,位置还是复用之前的。
解决方案是调用mLazySpanLookup对象里面的clear()方法,清除之前的数据。
目前我是通过反射调用LazySpanLookup对象的clear()方法
未来希望能将LazySpanLookup的clear()方法放出来,是StaggeredGridLayoutHelper对象也调用到,适应更多的场景。

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

No branches or pull requests

1 participant