在ViewController中实现下面两个方法就可以控制Cell的分割线的宽度
#pragma mark------设置tableviewCell的分割线的宽度①
- (void)viewDidLayoutSubviews {
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
[self.tableView setLayoutMargins:UIEdgeInsetsZero];
}
#pragma mark------设置tableviewCell的分割线的宽度②
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
[cell setSeparatorInset:UIEdgeInsetsZero];
[cell setLayoutMargins:UIEdgeInsetsZero];
//设置Cell的两边的间距来控制宽度
[cell setSeparatorInset:UIEdgeInsetsMake(0, 5, 0, 5)];
}