在放tableview的控制器里面添加下面代码就 OK 了,如图 image 中所示,下图是tableviewcell截图示范
-(void)viewDidLayoutSubviews
{
if ([self.displayTableview respondsToSelector:@selector(setSeparatorInset:)]) {
[self.displayTableview setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
}
if ([self.displayTableview respondsToSelector:@selector(setLayoutMargins:)]) {
[self.displayTableview 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];
}
}