gpt4 book ai didi

ios - 滚动时 UITableView 单元格变为空白

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:59:32 25 4
gpt4 key购买 nike

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

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

最佳答案

当表格 View 中的单元格框架滚动到表格 View 框架之外时,就会发生这种情况。

  • 您是否实现了 tableView:heightForRowAtIndexPath:

  • 那个高度是cell的高度吗?

  • 将单元格分解成多个单元格会更好吗在表格 View 的一个部分?

关于ios - 滚动时 UITableView 单元格变为空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33199583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com