3

A strange gray line has appeared on the top of my UITableView in iOS 5 (was never present until I upgraded to Xcode 4.3 and am running app on iOS 5 iPhone) - has anyone else seen this? I was also getting funny white lines in some of my other TableViewControllers that I got rid of by doing this:

    // needed to get rid of funny white lines in iOS 5
    tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
tableView.separatorColor = [UIColor clearColor]; 

However, this does not work to remove this line. There is no header title here. The line scrolls up and down with my UITableView settings

g_low
  • 2,435
  • 19
  • 23

3 Answers3

1

I have the same problem, but only it appears in Edit mode. I was need header, so previous answer not for me. But this answer help for me Remove top gray line on UITableViewCell , i hope it helps some one, who encountered with same problem.

tableView.separatorColor = [UIColor clearColor]; 
Community
  • 1
  • 1
DRS
  • 56
  • 4
0

You probably are implementing the heightForHeaderInSection method. Either delete it completely or return 0.

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.0;
}
Jacob K
  • 2,669
  • 1
  • 15
  • 20
0

If you had a simple background changing colorWithPatternImage with colorWithRed:green:blue:alpha will do the trick.

//self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
self.tableView.backgroundColor = [UIColor colorWithRed: green: blue: alpha:]

But for a background like this, if you can crop the background.png image in a way that tilted images make up the whole background, will remove the line on top.

Warif Akhand Rishi
  • 23,920
  • 8
  • 80
  • 107