2010-07-19 4 views
2

Je dois définir une image pour mon UITableViewController; si je viens d'une section sur le tableview il fonctionne très bien avec:fond personnalisé uitableview avec plus d'une section (IPHONE)

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

mais s'il y a 2 section l'image vient en double pour chaque section.

Répondre

4

N'utilisez pas d'image de modèle. Utilisez la propriété backgroundView de tableView:

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