以來呈現時(與dequeueReusableCellWithIdentifier)被重用細胞:你必須使用一個不同的標識符爲小區..我做了一個自定義的UITableViewCell子類它。
這是我的最後一個單元格是將加載X以上電池的特殊細胞代碼..按照這個邏輯
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == lastIndex) {
LoadingNextCellView *cell = [tableView dequeueReusableCellWithIdentifier:@"LoadingNextCell"];
if (cell == nil) {
cell = [[LoadingNextCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LoadingNextCell"];
}
cell.indexPath = indexPath;
cell.titleLabel.text = [NSString stringWithFormat:@"Loading next %d trees..",PRELOAD_TREES];
return cell;
} else {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}
}
return cell;
}
Customie你的細胞。
下面是所有單元格的分隔符? – Avi
你是否爲xperator屬性檢查器的Seperator屬性設置了? –
是的,我沒有從Xcode屬性檢查器中設置,解決問題 – DanielG