2015-11-04 107 views
1

当我将UITableViewCellSeparatorStyleNone设置为tableView时,仍然可以看到separatorview吗?如何在tableview中设置UITableViewCellSeparatorStyleNone?

我设置的tableview的财产,

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

,并考虑调试我还是找到了UITableViewCellSeparatorView在我的手机, 如何删除分隔看法?

+1

下面是所有单元格的分隔符? – Avi

+0

你是否为xperator属性检查器的Seperator属性设置了? –

+0

是的,我没有从Xcode属性检查器中设置,解决问题 – DanielG

回答

0

以来呈现时(与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你的细胞。

1

您可以在故事板的tableview中设置UITableViewCellSeparatorStyleNone。 在这里我附上屏幕截图以获得更多的说明。

How to set UITableViewCellSeparatorStyleNone

相关问题