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

那为啥不直接继承UICollectionViewFlowLayout呢? #212

Open
JC-Sung opened this issue Aug 27, 2024 · 1 comment
Open

那为啥不直接继承UICollectionViewFlowLayout呢? #212

JC-Sung opened this issue Aug 27, 2024 · 1 comment

Comments

@JC-Sung
Copy link

JC-Sung commented Aug 27, 2024

我自己写的继承于UICollectionViewFlowLayout,只需要增加columnCount一个属性,针对多组不同列,只需实现一个代理方法

  • (NSInteger)collectionView:(UICollectionView *)collectionView numberOfColumnsInSection:(NSInteger)section;
    而且还兼容了组头,组尾悬浮效果,使用起来和UICollectionViewFlowLayout一模一样
    把自己原来的列表换成瀑布流,甚至一行代码都不用写,非常好用
@JC-Sung
Copy link
Author

JC-Sung commented Aug 27, 2024

在CHTCollectionViewWaterfallLayout这个源码上,我也实现了悬浮效果,不过有瑕疵,组内items滚动一半超出屏幕header就不悬浮了,大家有没有完美的处理。。。

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

1 participant