views:

34

answers:

1

Hi, i need to set an image to my UITableviewcontroller; if i have just one section on the tableview works fine with:

self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"someImage.jpeg"]];

but if there are 2 section on tableview the image comes duplicate for each section.

Some idea?

Thanks in advanced

+2  A: 

Don't use a pattern image. Use the tableView's backgroundView property:

UIImageView * background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"someImage.jpeg"]];
[[self tableView] setBackgroundView:background];
[background release];
Dave DeLong