2014-09-22 99 views

回答

3

我把

[cell layoutIfNeeded]; 

dequeueReusableCellWithReuseIdentifier語句來之後,一切都好起來。

+0

爲什麼這沒有一百萬票? – Thompson 2015-05-07 19:46:42

1

我有同樣的問題。我試圖把[cell layoutIfNeeded];,但是當我刷新tableview,並不是所有的單元格刷新。 在返回單元格之前,代碼爲[cell layoutSubviews];,每次更新所有單元格。這是完整的代碼片段

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ 
MyCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath]; 
... 
[cell layoutSubviews]; 
return cell; 
} 
相關問題