【问题标题】:How to Set Vertical and Horizontal Scrolling to CollectionReusableView and CollectionVeiwCell respectively如何将垂直和水平滚动分别设置为 CollectionReusableView 和 CollectionVeiwCell
【发布时间】:2016-04-06 07:19:59
【问题描述】:
UICollectionView 的 ContentView 有两个 item。
- CollectionReusableView。
- CollectionViewCell。
在这里,我想将 CollectionReusableView 设置为具有垂直滚动方向的标题和具有水平滚动方向的 collectionVeiwCells。
我怎样才能做到这一点
这里,Top View 是 collectionReusableView,Bellow view 是 collectionViewCell。
我想单独为 CollectionveiwCells 进行水平滚动。
【问题讨论】:
标签:
uicollectionviewcell
uicollectionviewlayout
uicollectionreusableview
【解决方案1】:
我们不能为 UICollectionView 的单元格或 collectionReusableViews 分别设置水平和垂直滚动。只能单独设置滚动方向和弹跳到 UICollectionView 类。
我已经计划自定义带有拉伸标题的 UIView,为此我在两个带有 horizontal 的 collectionViewCells 中安排了两个单独的 UITableViews vertical scrolling > 滚动方向。这个 collectionveiw 应该是 UITableViewController 的一部分,静态单元格应该只有垂直滚动。为了更清楚地了解这一点,请参考下图。