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

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for -layoutAttributesForDecorationViewOfKind: ZLCollectionReusableView at path <NSIndexPath: 0xd75e8385f47ec650> {length = 2, path = 0 - 0}' #57

Open
tang786472181 opened this issue Jun 23, 2022 · 4 comments

Comments

@tang786472181
Copy link

collectionview在做insert的时候,有一定几率触发,出现过几次

collectionView.performBatchUpdates {
                        collectionView.insertItems(at: idx)
                    } completion: { _ in
                    }

参考1https://stackoverflow.com/questions/30562493/no-uicollectionviewlayoutattributes-instance-for-layoutattributesforitematinde
参考2https://stackoverflow.com/questions/38005641/no-uicollectionviewlayoutattributes-instance-for-layoutattributesforsupplementa
参考3https://stackoverflow.com/questions/20436022/using-uicollectionview-performbatchupdates-with-a-uicollectionviewflowlayout

@czl0325
Copy link
Owner

czl0325 commented Jun 25, 2022

能不能提供一个demo给我测试?

@krystal1110
Copy link

这个问题有解吗?我也遇到在 performBatchUpdates 删除的时候,布局会整个重新计算 导致闪一下

@czl0325
Copy link
Owner

czl0325 commented Dec 25, 2024

能否去掉动画?

@krystal1110
Copy link

因为本身做了diff刷新,不会走reloaddata, 大部分情况都是通过 performBatchUpdates 来动画实现的

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

No branches or pull requests

3 participants