UITableViewStylePlain样式下组头section不悬停

一、组头无颜色

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
    UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
    header.backgroundView.backgroundColor = UIColor.clearColor;
}

二、组头有颜色

SEL selector = NSSelectorFromString(@"_setHeaderAndFooterViewsFloat:");
((void (*) (id, SEL, BOOL))[self.tableView methodForSelector:selector]) (self.tableView, selector, NO);

转载于:https://www.jianshu.com/p/f321b5ac67e3

猜你喜欢

转载自blog.csdn.net/weixin_34234721/article/details/91190762