歡迎加入QQ討論群258996829

輕松處理UICollectionView流式布局的框架Blueprints

發(fā)布時間:2018-03-28 11:12  回復:0  查看:5149  感興趣:106  贊:4   最后回復:2018-03-28 11:12  
輕松處理UICollectionView流式布局的框架Blueprints,它配備了兩個內(nèi)置布局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)

相關開源代碼

您還未登錄,請先登錄

熱門帖子

最新帖子

?