self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableview.separatorColor = [UIColor redColor];
//定制表格单元分割线
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ClientManageCell *cell = [tableView dequeueReusableCellWithIdentifier:kClientTableViewCellIdentifier];
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsMake(0, 25, 0, 0)];
}
//给cell的model赋值
cell.clientManageModel = self.sectionArr[indexPath.section][indexPath.row];
return cell;
}
//定制表格单元分割线
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsMake(0, 25, 0, 0)];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsMake(0, 25, 0, 0)];
}
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.tableView.tableFooterView = [UIView new];
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.tableView setSeparatorInset:UIEdgeInsetsMake(0,15,0,0)];
}
if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.tableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];
}
[self.tableView reloadData];
}