修改UITableViewCell分割线距离左右的距离

 UITableView * _mainTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, JC_NavHeight, kScreenWidth, kScreenHeight - JC_NavHeight) style:UITableViewStyleGrouped];
    _mainTableView.delegate = self;
    _mainTableView.dataSource = self;
    [self.view addSubview:_mainTableView];
    [self.mainTableView deselectRowAtIndexPath:[self.mainTableView indexPathForSelectedRow] animated:YES];
    [_mainTableView   registerNib:[UINib nibWithNibName:@"JCPersonalCenterCell" bundle:nil] forCellReuseIdentifier:cellIndentiferID];
     self.mainTableView.bounces = NO;
    

    UIEdgeInsets  padding = UIEdgeInsetsMake(0, 15, 0, 15);
    [self.mainTableView setSeparatorInset:padding];
    [self.mainTableView setLayoutMargins:padding];

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    UIEdgeInsets  padding = UIEdgeInsetsMake(0, 15, 0, 15);
    [cell setSeparatorInset:padding];
    [cell setLayoutMargins:padding];
}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容