如何在水平滚动的UicollectionView中获得iglistkit到达太空项目



我找不到一种使用iglistkit 3.1.1的水平滚动 UICollectionView上项目之间间距的方法。

我尝试了不同的方法...

使用UICollectionViewFlowLayout

我这样设定了:

collectionLayout.minimumLineSpacing = 10.0
collectionLayout.minimumInteritemSpacing = 10.0

我也玩了sectionSinset,但徒劳无功...

使用ListCollectionViewLayout&自定义适配器

我使用IGListKitListCollectionViewLayout使用自定义适配器来实现UICollectionViewDelegateFlowLayout协议,但徒劳无功...

我得到的

我最终还获得了相互接触的水平部分(即0 pt的间距)。

iglistkit的任何人都可以帮助我吗?

源代码可在https://github.com/flaneurapp/flaneuropen/tree/0.3.0(cf。 collectionView demo 中)获得。配置收集视图的类是:https://github.com/flaneurapp/flaneuropen/blob/0.3.0.3.0/flaneuropen/classes/custom uiview/flaneurcollectionview.swift.swift

谢谢。

我有相同的问题,使用此问题解决了。

在您的部分控制器中,覆盖初始分散器:

override init() {
    super.init() 
    let halfCellSpacing = 10
    self.inset = UIEdgeInsets(top: 0, left: halfCellSpacing, bottom: 0, right: halfCellSpacing)
}

最新更新