Question

c'est l'appdelegate:

  UINavigationController *moreController = _tbc.moreNavigationController;
    moreController.navigationBar.tintColor = [UIColor blackColor];


    UIImage *image = [UIImage imageNamed:@"navBar.png"]; 
    [image drawInRect:rect];



    /*    UITableView *moreTableView = (UITableView *)moreController.topViewController.view;
     //   [moreTableView initWithFrame:CGRectZero style:UITableViewStyleGrouped];
     [moreTableView setBackgroundColor:BACKGROUNDCOLOUR];*/

il ne fonctionne que si je change la couleur d'arrière-plan, mais comment puis-je faire pour remplacer l'arrière-plan avec une image?


[ S O L V E D ]

Maintenant sa marche!!!!

[moreController.navigationBar setBackgroundImage:[UIImage imageNamed: @"navBar.png"] forBarMetrics:UIBarMetricsDefault];

Était-ce utile?

La solution

J'ai trouvé que ce n'travail, a été mis en œuvre [navBar setBackgroundImage:[UIImage imageNamed: @"image.png"] forBarMetrics:UIBarMetricsDefault];

Aussi jeter un oeil sur l'Apple Docs sur ce https://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html Il donne de plus amples explications sur quoi et comment personnaliser UINavigationBar.La cible doit être iOS5+

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top