这里有一个简单的一招:你必须在故事板添加连接空UIView
您UITableView
内。设置为height = 0
。
UITableView
的最后一个分隔符会奇迹般消失。
编辑:
您还需要编辑cellForRowAtIndexPath:
这样的:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"];
if (indexPath.row == [self tableView:tableView numberOfRowsInSection:[self numberOfSectionsInTableView:tableView]-1]-1) {
//this is the last cell
cell.separatorInset = UIEdgeInsetsMake(0, cell.bounds.size.width, 0, 0);
} else {
cell.separatorInset = UIEdgeInsetsMake(0, 0, cell.bounds.size.width, 0);
}
return cell;
}
谢谢!这将有很大帮助。但它只删除所有单元格的分隔符,位于“正在加载...”单元格的下面。装载单元的下分离器仍然显示。 – QuantumHoneybees
[这是截图](http://i.imgur.com/DzN6tIb.png) – QuantumHoneybees
更新了我的回答 – guidev