【发布时间】:2017-11-14 05:14:46
【问题描述】:
目前我正在使用 swift 3 和故事板,谷歌搜索所有内容并查看了所有 stackoverflow 类似问题,到目前为止一无所获。
在我的示例项目中,
我的收藏视图如下所示 Simulator Screenshot
这不是我想要的,我想要一个完全没有间距的网格布局,我编辑了情节提要的值,在那里没有任何东西,所以我使用了这个代码
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
let width = UIScreen.main.bounds.width
layout.sectionInset = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)
layout.itemSize = CGSize(width: width / 2, height: width / 2)
layout.minimumInteritemSpacing = 0
layout.minimumLineSpacing = 0
collectionView!.collectionViewLayout = layout
也没有用:(
【问题讨论】:
标签: swift layout uicollectionview