Aaron Wojnowski Aaron Wojnowski - 25 days ago 17
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?

screenshots

Answer
-(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;
}