项目
在 GitHub 查看 
keighl/KTCenterFlowLayout
关于
将集合视图单元格对齐到屏幕中央。
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文KTCenterFlowLayout
KTCenterFlowLayout is a subclass of UICollectionViewFlowLayout which Aligns cells to the center of a collection view. It effectively enforces the minimumInteritemSpacing.
Usage
# 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
See the layout in use in the ./Example app:

Horizontal Scrolling
This layout doesn't work with UICollectionViewScrollDirection.horizontal.
Self-sizing cells
This layout doesn't work with self-sizing collection view cells (estimatedItemSize). Of course, neither does the vanilla UICollectionViewFlowLayout. Pull requests appreciated from anybody interested in solving self-sizing layouts!
探索相关项目
加载中…