【发布时间】:2018-01-05 07:08:44
【问题描述】:
我使用 UICollectionView 并设置水平滚动。现在在这一个图像视图中,除了单元格间距外,所有工作都完美无缺。在 collectionView 中,我为单元格 0(零)设置了最小间距。但是 Spaces 仍然存在。
但我需要这种类型的输出..
还有一件事是我参考了这么多答案,但仍然不知道该怎么做。我使用 Xcode 7.0,所以我需要 swift 2.0 中的解决方案,如果可能的话,还要求在 swift 3.0 中给出答案。 请帮我。提前致谢。
【问题讨论】:
-
你用代码试过了吗?检查这个:stackoverflow.com/questions/28325277/…
-
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat { return 0 } func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) - > CGSize { return CGSize(width: 155, height: 155) } 我也放了 UICollectionViewDelegateFlowLayout 这个方法但是还是不行..
-
你确定委托人被叫到了吗??
-
尝试在我提供的链接中显示的
viewDidLoad。 -
Yaa.. 我把断点放在那里.. 所以方法调用但不工作。
标签: ios swift uicollectionview swift2 uicollectionviewcell