在该自定义cell类的.m实现位置,加入如下代码。
#pragma mark removeSeparatorLine
- (void)addSubview:(UIView *)view
{
if (!([view isKindOfClass:[NSClassFromString(@"_UITableViewCellSeparatorView") class]] && CGRectEqualToRect(view.frame, CGRectMake(0, 0, 375, 0.5))))
[super addSubview:view];
}
ps:
CGRectEqualToRect(view.frame, CGRectMake(0, 0, 375, 0.5)))这个为额外附加条件,如果cell的line已经被处理过frame的话,可以加入这个,以移除除此以外cell上的line。