簡體   English   中英

滾動時,UITableView單元格為空白

[英]UITableView cell goes blank when scrolling

我在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;
}

當滾動表格視圖中單元格的框架使其位於表格視圖框架之外時,可能會發生這種情況。

  • 您實現tableView:heightForRowAtIndexPath:嗎?

  • 那是細胞的高度嗎?

  • 將單元格更好地用作表格視圖的一部分中的幾個單元格嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM