FWCollectionViewFlowLayout
@interface FWCollectionViewFlowLayout : UICollectionViewFlowLayout
系统FlowLayout水平滚动时默认横向渲染,可通过本类开启纵向渲染 示例效果如下: [0 3 6 9 ] [0 1 2 3 ] [1 4 7 10] => [4 5 6 7 ] [2 5 8 11] [8 9 10 11]
-
是否启用元素纵向渲染,默认关闭,开启时需设置渲染总数itemRenderCount
Declaration
Objective-C
@property (nonatomic) BOOL itemRenderVertical;
-
纵向渲染列数,开启itemRenderVertical且大于0时生效
Declaration
Objective-C
@property (nonatomic) NSUInteger columnCount;
-
纵向渲染行数,开启itemRenderVertical且大于0时生效
Declaration
Objective-C
@property (nonatomic) NSUInteger rowCount;
-
计算实际渲染总数,超出部分需渲染空数据,一般numberOfItems中调用
Declaration
Objective-C
- (NSInteger)itemRenderCount:(NSInteger)itemCount;
-
转换指定indexPath为纵向索引indexPath,一般无需调用
Declaration
Objective-C
- (nonnull NSIndexPath *)verticalIndexPath:(nonnull NSIndexPath *)indexPath;