[英]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.