使用以下方式: if (indexPath.row == {your row number}){ cell.separatorInset = UIEdgeInsetsMake(0, 15, 0, 0); } 在 iOS7 中,表格视图默认具有 15 个左插入分隔符,您可以使用上面的代码根据需要进行更改。
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; 根据文档,UITableViewCellSeparatorStyleSingleLine 分隔符单元格具有横跨其宽度的单行。这是默认值。在iOS 2.0及更高版本中可用。