/ZFFlowLayout

ZFFlowLayout : UICollectionView左对齐流水布局、右对齐流水布局

Primary LanguageObjective-CApache License 2.0Apache-2.0

ZFFlowLayout 流水布局

流水布局的思路是:

通过UICollectionViewFlowLayout的代理方法:

-(NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect

拿到UICollectionView元素的原始布局实例,然后按照想实现的效果修改原始的布局实例属性值。

首页如图所示

首页

左对齐流水布局如图所示

左对齐流水布局

右对齐流水布局如图所示

右对齐流水布局