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

第三方瀑布流CHTCollectionViewDelegateWaterfallLayout #179

Open
fanyuexiang opened this issue Oct 18, 2021 · 5 comments
Open

第三方瀑布流CHTCollectionViewDelegateWaterfallLayout #179

fanyuexiang opened this issue Oct 18, 2021 · 5 comments
Labels

Comments

@fanyuexiang
Copy link

使用了CHTCollectionViewDelegateWaterfallLayout实现瀑布流,结果crash,因为((UICollectionView *)target).dataSource = self.protocolContainer;这里protocolContainer没有遵守CHTCollectionViewDelegateWaterfallLayout协议,这种情况该怎么兼容

@tigerAndBull
Copy link
Owner

设置waterFallLayoutHeightSel

@fanyuexiang
Copy link
Author

设置了,还是会停到CHTCollectionViewDelegateWaterfallLayout的断言里。
这里UICollectionView的layout是CHTCollectionViewDelegateWaterfallLayout,它需要遵守CHTCollectionViewDelegateWaterfallLayout协议。而在TABCollectionAnimated里面通过rebindDelegate把collectionView的delegate转为protocolContainer,这个protocolContainer无法遵守CHTCollectionViewDelegateWaterfallLayout协议
QQ20211018-163623@2x

@tigerAndBull
Copy link
Owner

这里规定参数顺序必须一致。瀑布流的方案大体上都是一致的,你可以改下接口参数的顺序

@tigerAndBull
Copy link
Owner

可以优化为参数自动调整,但是意义不是很大

@Pengjun1993
Copy link

作者你好,我这边用了CHTCollectionViewDelegateWaterfallLayout实现的瀑布流,然后更改了代理方法实现了骨架。但是我目前碰到了一个问题,就是我的骨架cell高度会随我设置的高度来,但是里面的元素不会跟着高度变化而变化,只会按下标0的高度固定展示元素。 比如我cell上有一个UIView,我设置的高度是cell高度-20,那么假如下标0的cell高度为100,下标1的cell高度为200的话,这个UIView的高度也只会固定展示为80。请问这个是我写的有问题吗?

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

No branches or pull requests

3 participants