Search code examples
objective-cxcode4.2storyboarduinavigationitem

objective C , setting the navigation bar background color


I am making a storyboard application using XCode 4.2

I am trying to set the color of the background of the navigation bar but cant find anyway to do that.

I found a way to set the text (see below), but not the title

    [[self navigationItem] setTitle:@"title text"];

I would like the background of the navigation bar to be black

thanks!


Solution

  • UINavigationBar *bar = [self.navigationController navigationBar];
    [bar setTintColor: [UIColor blackColor]];