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