滚动时UITableView单元格变为空白

时间:2015-10-18 15:11:58

标签: ios objective-c uitableview

我在UITableViewController中设置了一个单个单元格自定义单元格,以显示比屏幕更长的视图。但是在测试时,我注意到在离开视图区域之前向下滚动时,单元格将消失(变为空白)。它没什么特别的,但是我不明白为什么它会在向下滚动时消失,特别是当它离可见区域不远时。

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

1 个答案:

答案 0 :(得分:2)

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

  • 您是否实施了tableView:heightForRowAtIndexPath:

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

  • 细胞被分解成几个细胞会更好吗? 在表格视图的一个部分?