测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最新发布 | 2017年2月 |
SwiftSwift 版本 | 3.0.2 |
SPM支持 SPM | ✗ |
由 Nicolas Kim 维护。
要运行示例项目,首先克隆仓库,然后从示例目录运行 pod install
。
ELWaterFallLayout 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "ELWaterFallLayout"
import ELWaterFallLayout
lazy var flowLayout : ELWaterFlowLayout = ELWaterFlowLayout()
collectionView = UICollectionView(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: self.view.frame.size.width, height: self.view.frame.size.height - 200)) , collectionViewLayout:flowLayout)
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
self.flowLayout.delegate = self
flowLayout.lineCount = 10//十列
flowLayout.vItemSpace = 10//水平间距10
flowLayout.hItemSpace = 10//水平间距10
flowLayout.hItemSpace = 10//水平间距10
flowLayout.edge = UIEdgeInsets.zero
collectionView.register(TestCollectionViewCell.self, forCellWithReuseIdentifier: "cell")
self.view.addSubview(collectionView)
func el_flowLayout(_ flowLayout: ELWaterFlowLayout, heightForRowAt index: Int) -> CGFloat {
//do something for the cell height
return height
}
ELWaterFallLayout 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。