得到Collection View信息:
-(CGSize)collectionViewContentSize
返回Collection View's contents的宽度和高度
提供布局属性:
+(Class)layoutAttributesClass
返回创建布局属性对象时要用的类
-(void)prepareLayout
告诉布局对象去更新当前的布局
-(NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
返回指定区域内所有cells和views的布局属性
-(UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath
返回一个包含适用于indexPath处item's cell的信息的布局属性对象。
-(UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
返回一个包含指定supplementary view的信息的属性列表对象
-(UICollectionViewLayoutAttributes *)layoutAttributesForDecorationViewOfKind:(NSString *)decorationViewKind atIndexPath(NSIndexPath *)indexPath
返回指定decoration view的布局属性。
-(CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset
返回一个可动的布局更新或改变之后的内容偏移。
-(CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
返回停止滑动的坐标点。
proposedContentOffset |
The proposed point (in the collection view’s content view) at which to stop scrolling. This is the value at which scrolling would naturally stop if no adjustments were made. The point reflects the upper-left corner of the visible content. |
velocity |
The current scrolling velocity along both the horizontal and vertical axes. This value is measured in points per second. |
返回一个被插入到Collection View中的一个item的启动布局信息。