Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tools & Utilities

Reply
 
LinkBack Thread Tools Display Modes
Old 11-03-2011, 09:47 PM   #1 (permalink)
Tech Genius Developer
 
Join Date: Jul 2011
Posts: 40
vilisei is on a distinguished road
Send a message via Skype™ to vilisei
Default UINavigationBar Background

I know in pre iOS 5, you could change the background of a UINavigationBar and Toolbar in s rather complicated process. Now with iOS 5, Apple made an easier way. I am working on a new app in storyboard and I would like to know how, because Apple's way is hard to understand and I can't find any other tutorials any where else.
vilisei is offline   Reply With Quote
Old 11-04-2011, 01:17 AM   #2 (permalink)
apps, dude
 
Join Date: Oct 2011
Location: Brooklyn, NY
Posts: 4
meekismurder is on a distinguished road
Default

self.navigationController.navigationBar.tintColor = [UIColor greenColor];

tintColor is available as an attribute for UINavigationController in Storyboard as well.
meekismurder is offline   Reply With Quote
Old 11-04-2011, 08:35 AM   #3 (permalink)
Tech Genius Developer
 
Join Date: Jul 2011
Posts: 40
vilisei is on a distinguished road
Send a message via Skype™ to vilisei
Default UINavigationBar Background

I don't need to change the color, I have my own image I want to use. And if I change it for the UINavigation, will the UIToolbar also change? Also I forgot to say that this app is universal and I would like to make the toolbar on the iPhone different from the iPad. Is that possible or do I have to make them 2 separate apps?
vilisei is offline   Reply With Quote
Old 11-05-2011, 07:37 AM   #4 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 14
lynngobin is on a distinguished road
Default

Is this what you're looking for?

Code:
UIImage *navBarImage = [UIImage imageNamed:@"navigationbar"];
UIColor *navBarTint = [UIColor colorWithRed:191/256.0 green:0/256.0 blue:8/256.0 alpha:1.0];

ViewController *viewController = [[ViewController alloc] initWithNibName:@"View" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
UINavigationBar *navBar = [navigationController navigationBar];
[navBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
[navBar setTintColor:navBarTint];
lynngobin is offline   Reply With Quote
Old 11-05-2011, 09:28 AM   #5 (permalink)
Tech Genius Developer
 
Join Date: Jul 2011
Posts: 40
vilisei is on a distinguished road
Send a message via Skype™ to vilisei
Default

Quote:
Originally Posted by lynngobin View Post
Is this what you're looking for?

Code:
UIImage *navBarImage = [UIImage imageNamed:@"navigationbar"];
UIColor *navBarTint = [UIColor colorWithRed:191/256.0 green:0/256.0 blue:8/256.0 alpha:1.0];

ViewController *viewController = [[ViewController alloc] initWithNibName:@"View" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
UINavigationBar *navBar = [navigationController navigationBar];
[navBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
[navBar setTintColor:navBarTint];
Kind of. First of all, is it the new code for iOS 5? It looks different than the code from the other user. I just need the navBarImage but will this change the toolbar on the iPad as well as the iPhone since my app is universal? Last thing, do I post this code in the App Delegate like before or in each individual *.h and *.m?
vilisei is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 408
9 members and 399 guests
7twenty7, gwelmarten, mer10, QuantumDoja, Retouchable, RobTaku, SLIC, tim0504, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,925
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:37 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0