invalidateLayout() | — | void | 标记布局失效,触发重新计算。 |
registerClassForDecorationViewOfKind(viewClass, decorationViewKind) | viewClass: id, decorationViewKind: string | void | 注册 decoration view 类型。 |
prepareLayout() | — | void | 布局准备阶段回调。 |
layoutAttributesForElementsInRect(rect) | rect: { x: number, y: number, width: number, height: number } | NSArray | 返回 rect 内元素的布局属性数组。 |
layoutAttributesForItemAtIndexPath(indexPath) | indexPath: NSIndexPath | UICollectionViewLayoutAttributes | null | 返回指定 item 的布局属性。 |
layoutAttributesForSupplementaryViewOfKindAtIndexPath(kind, indexPath) | kind: string, indexPath: NSIndexPath | UICollectionViewLayoutAttributes | null | 返回指定 supplementary view 的布局属性。 |
layoutAttributesForDecorationViewOfKindAtIndexPath(decorationViewKind, indexPath) | decorationViewKind: string, indexPath: NSIndexPath | UICollectionViewLayoutAttributes | null | 返回指定 decoration view 的布局属性。 |
shouldInvalidateLayoutForBoundsChange(newBounds) | newBounds: { x: number, y: number, width: number, height: number } | boolean | bounds 变化时是否需要失效布局。 |
targetContentOffsetForProposedContentOffsetWithScrollingVelocity(proposedContentOffset, velocity) | proposedContentOffset: { x: number, y: number }, velocity: { x: number, y: number } | { x: number, y: number } | 根据目标偏移与滚动速度修正最终停靠位置。 |
targetContentOffsetForProposedContentOffset(proposedContentOffset) | proposedContentOffset: { x: number, y: number } | { x: number, y: number } | 根据目标偏移修正最终停靠位置。 |
collectionViewContentSize() | — | { width: number, height: number } | 返回内容尺寸。 |