[英]What method is triggered on a custom CollectionViewCell when dequeued from a reusable Cell?
我像往常一样使用其父ViewController中的方法将可重用的自定义ItemCollectionViewCell
出列
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
ItemCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
}
但是在我的ItemCollectionViewCell
我实现了initWithFrame
方法,该方法最初只是被调用,但是当一个单元格被重新出现以便重复使用时。
在父视图控制器上调用[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]
之后,在重新添加到队列之前,在ItemCollectionView
内触发的方法是什么?
-[UICollectionReusableView prepareForReuse]
是方法。 这是该方法的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.