滚动时,UITableView单元格变空白

我已经在UITableViewController中设置了单个部分,单个单元格自定义单元格来显示比屏幕更长的视图。 但是在testing时,我注意到在离开视图区域之前向下滚动时单元格会消失(空白)。 这不是什么幻想,但我不明白为什么滚动下来会消失,尤其是当它远离可视区域时。

- (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; } 

当表视图中单元格的框架滚动,因此在表格视图的框架之外时,可能会发生这种情况。

  • 你实现tableView:heightForRowAtIndexPath:

  • 这个高度是单元格的高度吗?

  • 这个单元格能更好地被分解成一个表格视图的几个单元格吗?