第一步:spa
-(void)viewDidLayoutSubviews {table
if ([_leftTableView respondsToSelector:@selector(setSeparatorInset:)]) {select
[_leftTableView setSeparatorInset:UIEdgeInsetsZero];tab
}view
if ([_leftTableView respondsToSelector:@selector(setLayoutMargins:)]) {vi
[_leftTableView setLayoutMargins:UIEdgeInsetsZero];void
}index
}ab
第二步:play
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
[cell setSeparatorInset: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];
}
}