Independent scrolling for each section of a UICollectionView?

我们两清 提交于 2019-12-03 22:11:13

You can put multiple UICollectionViews in table cells. The table scrolls vertically. The collection views can be configured to scroll horizontally. I'm doing this on a complex layout and it works well. One constraint to consider is it is much more difficult to do animations that need to move from one table cell to another and you can't use a neat single change of collection view layout to animate all the items in your table view. But if these constraints aren't a problem then this is a relatively easy solution.

This is a pretty common issue that I've needed to solve multiple times, and I've created a UICollectionViewLayout that solves this in a clean way without creating multiple collection views, meaning it supports moving items between sections etc.

https://github.com/accatyyc/JEKScrollableSectionCollectionViewLayout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!