tableview线条连接不完整

原图

 

修改后

 

-(void)viewDidLayoutSubviews

{

    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)])

    {

        [self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];

    }

    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)])

    {

        [self.tableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];

    }

}

 

-(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];

    }

}

posted on 2015-09-09 14:44  廖利君  阅读(161)  评论(0编辑  收藏  举报