2013-01-09 28 views
4

我出列一個可重複使用的自定義ItemCollectionViewCell像往常一樣從它的父視圖控制器從可重用單元出列時,自定義CollectionViewCell觸發了什麼方法?

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 
    ItemCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; 
} 

但我ItemCollectionViewCell方法我已經實現的方法initWithFrame只得到最初,但不叫當細胞出隊重新-使用。

在父視圖控制器上調用[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]之後,在被重新添加到隊列之前在ItemCollectionView內被觸發的方法是什麼?

回答

6

-[UICollectionReusableView prepareForReuse]是該方法。 Here是該方法的文檔。

相關問題