KTCenterFlowLayout 1.3.1

KTCenterFlowLayout 1.3.1

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布上次发布2016 年 10 月

Kyle Truscott 维护。



KTCenterFlowLayout 是 UICollectionViewFlowLayout 的子类,用于将 cell 对齐到 collection view 的中心。它有效地强制了 minimumInteritemSpacing

用法

# In your Podfile

pod 'KTCenterFlowLayout'

Objective-C

KTCenterFlowLayout *layout = [KTCenterFlowLayout new];
layout.minimumInteritemSpacing = 10.f;
layout.minimumLineSpacing = 10.f;

[[UICollectionViewController alloc] initWithCollectionViewLayout:layout];

Swift

let layout = KTCenterFlowLayout()
layout.minimumInteritemSpacing = 10.0
layout.minimumLineSpacing = 10.0

UICollectionViewController(collectionViewLayout: layout)

示例

查看示例应用 ./Example 中使用的布局

自适应大小的 cells

这个布局与自适应大小的 collection view cells(estimatedItemSize)不兼容。当然,纯的 UICollectionViewFlowLayout 也不兼容。欢迎任何感兴趣的人提交拉取请求以解决自适应布局问题!