2015-10-18 136 views
2

我已經在UITableViewController中設置了單個單元格,單元格自定義單元格以顯示比屏幕更長的視圖。然而,在測試時,我注意到在離開視圖區域之前向下滾動時單元格會消失(變空白)。這不是什麼幻想,但我不明白爲什麼它會在滾動時消失,特別是當它遠離可視區域時。滾動時UITableView單元格變空白

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

VendorDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"VendorDetailCell"]; 
cell.vendorImage.image = [UIImage imageWithData: self.imageData.data]; 
cell.vendorTitle.text = self.imageData.vendorTitle; 
cell.vendorDescription.text = self.imageData.vendorDescription; 



    return cell; 
} 
+0

你必須分配的情況下,'的tableView dequeueReusableCellWithIdentifier細胞:'不通過檢查'如果(細胞==零)'那麼你就必須分配您的自定義單元格返回一個細胞,我相信:) – ErickES7

回答

2

當滾動在表格視圖中的小區的幀因此它的表視圖的幀以外會發生這種情況。

  • 您是否實施tableView:heightForRowAtIndexPath:

  • 那高度就是細胞的高度嗎?

  • 請問細胞得到更好的服務爲被分成幾個單元表視圖的一個部分 ?

相關問題