0414--iOS之UICollectionViewLayoutInvalidationContext类

UICollectionViewLayoutInvalidationContext是iOS中用于标记布局需要更新的部分的上下文对象。它可以帮助优化在invalidation周期中的布局行为。当布局、数据源改变,或者插入、删除items时,系统会创建此上下文。可以通过子类化来定制需要单独失效的布局数据,并通过特定方法更新布局。该类涉及的内容包括:数据无效化、内容区域无效化、特定items无效化以及items顺序无效化。
摘要由CSDN通过智能技术生成

Class

UICollectionViewLayoutInvalidationContext

A context object that declares which parts of your layout need to be updated when the layout is invalidated.

     --一个用于无效化的上下文对象,声明当布局无效时需要更新布局的哪些部分
 

Declaration

class UICollectionViewLayoutInvalidationContext : NSObject

Overview           --概览

Layout objects that are designed to support invalidation contexts can use the information in a UICollectionViewLayoutInvalidationContext object to optimize their behavior during the invalidation cycle. You can create an invalidation context object as a precursor to invalidating a layout object. After configuring the invalidation context object, pass it to the layout object’s invalidateLayout(with:) method, which is responsible for using the context object to update the layout efficiently. The collection view also creates invalidation contexts in response to specific changes. For example, it creates an invalidation context when you change the layout or data source object, when you insert or delete items, and when you call the reloadData() method.

       --设计用来支持“无效上下文”的布局对象可以使用uiCollectionViewLayoutValidationContext对象中的信息来优化它们在无效化的运行循环期间的行为。你可以创建“无效上下文”

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值