Aaron Wojnowski Aaron Wojnowski - 1 year ago 116
iOS Question

White Separator Above Table Section Headers

I'm having a really weird issue with table view separators. I have set the separator color to a dark gray which works great below the cells, but for some reason, there is a white separator before my section header (see the screenshot, above November). When I set the separator style to none, the line disappears which indicates that it is a separator. How can I remove this white separator line?


Answer Source
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section

        UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)];
        UIView *v2 = [[UIView alloc] initWithFrame:CGRectMake(0, -1, 320, 2)];
        v2.backgroundColor = [UIColor blackColor];//Your color
        v.backgroundColor = [UIColor blackColor];//Your color
        [v addSubview:v2];

        return v;


-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
    return 0.01f;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download