设置table分割线靠左边0距离对齐

来源:互联网 发布:php 数组去重 编辑:程序博客网 时间:2024/06/05 04:06

在viewDidload 加下面代码
 if ([self.table respondsToSelector:@selector(setSeparatorInset:)]) {                [self.table setSeparatorInset:UIEdgeInsetsZero];            }        if ([self.table respondsToSelector:@selector(setLayoutMargins:)]) {                [self.table setLayoutMargins:UIEdgeInsetsZero];            }

实现方法
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{        if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {                [cell setSeparatorInset:UIEdgeInsetsZero];            }        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {                [cell setLayoutMargins:UIEdgeInsetsZero];            }    }

0 0