以来呈现时(与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