欢迎加入QQ讨论群258996829

轻松处理UICollectionView流式布局的框架Blueprints

发布时间:2018-03-28 11:12  回复:0  查看:230  感兴趣:8  赞:0   最后回复:2018-03-28 11:12  
轻松处理UICollectionView流式布局的框架Blueprints,它配备了两个内置布局Vertical layout和Horizontal layout。

Vertical layout示例代码:
let blueprintLayout = VerticalBlueprintLayout(
  itemsPerRow: 1.0,
  itemSize: CGSize(width: 200, height: 60),
  minimumInteritemSpacing: 10,
  minimumLineSpacing: 10,
  sectionInset: EdgeInsets(top: 10, left: 10, bottom: 10, right: 10),
  stickyHeaders: true,
  stickyFooters: false
)
let collectionView = UICollectionView(frame: .zero,
                                      collectionViewLayout: blueprintLayout)

Horizontal layout示例代码:
let blueprintLayout = HorizontalBlueprintLayout(
  itemsPerRow: 1.0,
  itemsPerColumn: 2,
  itemSize: CGSize(width: 200, height: 200),
  minimumInteritemSpacing: 10,
  minimumLineSpacing: 10,
  sectionInset: EdgeInsets(top: 10, left: 10, bottom: 10, right: 10),
  stickyHeaders: true,
  stickyFooters: true
)
let collectionView = UICollectionView(frame: .zero,
                                      collectionViewLayout: blueprintLayout)

相关开源代码

您还未登录,请先登录

热门帖子

最新帖子