collection view方法杂记

得到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.

-(UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath

返回一个被插入到Collection View中的一个item的启动布局信息。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值