在viewDidLayoutSubviews对于tableview进行设置
- (void)viewDidLayoutSubviews {
if ([self.tableview respondsToSelector:@selector(setSeparatorInset:)]) {[self.tableview setSeparatorInset:UIEdgeInsetsZero];
}
if ([self.tableview respondsToSelector:@selector(setLayoutMargins:)]) {[self.tableview setLayoutMargins:UIEdgeInsetsZero];
}
}
在cell即将展示的时候对于cell进行设置
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
[cell setSeparatorInset:UIEdgeInsetsZero];
}
}