UICollectionView可以使用柱状布局垂直滚动吗?

时间:2017-01-04 18:13:31

标签: ios uicollectionview uicollectionviewlayout

我正在构建需要垂直滚动的UICollectionView,但是以列式格式布置其项目以处理不同的项目高度,如下所示:

enter image description here

逐列布局是水平滚动集合视图的默认布局,但我需要垂直滚动。最简单的方法是什么?我是否需要继承UICollectionViewLayout,或者UICollectionViewFlowLayout可以执行此操作吗?还是...?

1 个答案:

答案 0 :(得分:0)

感谢您的评论。事实证明,在github上有一个名为https://github.com/ReactTraining/react-router/blob/master/docs/guides/NavigatingOutsideOfComponents.md的UICollectionViewLayout的子类,它正是我所需要的。