iOS-解决UITableView有footerView时最后一个cell不显示分割线问题

重写UITableViewCell子类的layoutSubviews方法

- (void)layoutSubviews {
    [super layoutSubviews];
    for (UIView *subview in self.contentView.superview.subviews) {
        if ([NSStringFromClass(subview.class) hasSuffix:@"SeparatorView"]) {
            subview.hidden = NO;
            CGRect frame = subview.frame;
            frame.origin.x += self.separatorInset.left;
            frame.size.width -= self.separatorInset.right;
            subview.frame =frame;
        }
    }
}

你可能感兴趣的:(iOS-解决UITableView有footerView时最后一个cell不显示分割线问题)