Ios 如何在UICollectionView中添加可滚动高度
我试图使UI如下所示: 我正在使用以下代码:Ios 如何在UICollectionView中添加可滚动高度,ios,swift,uicollectionview,Ios,Swift,Uicollectionview,我试图使UI如下所示: 我正在使用以下代码: override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { let start = (indexPath.row % 2 == 0) ? 2 : 1 let finish = (self.collectionView?.numberOfItemsInS
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
let start = (indexPath.row % 2 == 0) ? 2 : 1
let finish = (self.collectionView?.numberOfItemsInSection(indexPath.section))!
for i in start..<finish {
let path = NSIndexPath(forRow: indexPath.row + i, inSection: indexPath.section)
let cell = collectionView.cellForItemAtIndexPath(path)
cell?.center.y += 100
}
override func collectionView(collectionView:UICollectionView,didSelectItemAtIndexPath indexPath:NSIndexPath){
让start=(indexPath.row%2==0)?2:1
让finish=(self.collectionView?.numberOfItemsInSection(indexPath.section))!
对于“我在开始”中。发布您视图的屏幕截图,然后使用scrollview大小和您的内容视图大小更新问题。我应该在那里更新什么?您发布的图像看起来不像单个集合视图。所有单元格大小是否相等?