简体   繁体   中英

How can I customize the color of the Navigation Bar?

I am BRAND new to iOS development and am building my first app using Xcode 4.3.2 for iOS5. I am also using storyboards.

I want the background color of my navigation bar to be black instead of the default blue color for all of my views in the storyboard. I have researched everywhere and cannot find anything that works. Either the code generates error messages or its not clear (to me) where to put it. Can anyone help?!!!

Have you tried...

UIImage *image = [UIImage imageNamed:@"navBarImg.png"];
[self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

Also check out this -link- for more info relating to your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM