共两步:
第一步:
if ([self.meZanNewstableview respondsToSelector:@selector(setSeparatorInset:)]) {
[self.meZanNewstableview setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
}
if ([self.meZanNewstableview respondsToSelector:@selector(setLayoutMargins:)]) {
[self.meZanNewstableview 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];
}
}