UITableView 分割线边距

self.tableView.separatorInset = UIEdgeInsetsMake(0, 28, 0, 0);        //28为左边距

 #pragma mark  line
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{

    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }

    if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
        [cell setPreservesSuperviewLayoutMargins:NO];
    }
}

你可能感兴趣的:(UITableView 分割线边距)