Discussion Forums  >  Status Bar, Navigation Bar

Replies: 16    Views: 299

drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
03/11/12 05:17 PM (12 years ago)

Sizing of Navigation Bar Image

I recently replaced the regular nav bar with an image I created. Works great for the iphone but on an ipad it is too small and it repeats my image I created across the top. How can I place another image that fits the ipad nav bar as well? I placed this code in BT_viewUtilities.m. The code I used to replace the nav bar with an image is as follows: if([theViewController.navigationController.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) { //iOS 5 new UINavigationBar custom background [theViewController.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@navbarv1.png] forBarMetrics: UIBarMetricsDefault]; }else{ [theViewController.navigationController.navigationBar insertSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:@navbarv1.png]] autorelease] atIndex:0]; } Thank you in advance,
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/12/12 04:39 PM (12 years ago)
Have you tried replacing the navigation bar with an image on buzztouch.com? Are you using BT2.0?
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 07:00 PM (12 years ago)
No I have not!! I don't know we can replace it on buzz touch now!!
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 07:03 PM (12 years ago)
I started my app on 1.5. How do I switch to 2.0??
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/12/12 07:08 PM (12 years ago)
This feature is in 1.5, but right now, there does not seem to be a way to upgrade.
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 07:26 PM (12 years ago)
I started my app on 1.5. How do I switch to 2.0??
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 07:27 PM (12 years ago)
I will have to check, cause I didn't see it in 1.5!!
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 10:19 PM (12 years ago)
I am using 1.5 but there is no option to change the nav bar image.
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/12/12 10:32 PM (12 years ago)
I just tried 2.0 and this does not have an option to change the nav bar to an image of your own.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/12/12 10:38 PM (12 years ago)
What type of screen are you using?
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/13/12 06:28 AM (12 years ago)
Tabbed layout with a home screen button design!! But that doesn't matter cause the nav bar stays the same at the top!!
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/13/12 09:58 AM (12 years ago)
Here is how I would approach this: 1. Load a screen into the control panel 2. Go down to the advanced options 3. Click on Navigation Bar/Status Bar 4. Then set Nav. Bar Style to "Hit the navigation Bar" 5. Then go down the page to Header Image 6. Place the file name in the corresponding boxes 7. Drag the file into Xcode, or upload the file to a web server depending on your option in #6 I hope this answers your questions. Jake
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/13/12 11:11 AM (12 years ago)
I will try that!! But if I do it this way I won't be able to have any buttons on the top in the nav bar!! Is that correct?
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/13/12 11:13 AM (12 years ago)
This is correct, but it is worth it. You can probably even have a transparent nav bar overlay the image, which would give it a cool look and give you the ability to have buttons.
 
drmikeb
Apple Fan
Profile
Posts: 111
Reg: Feb 09, 2012
Montreal
1,110
like
03/13/12 11:37 AM (12 years ago)
Is there a way to just add code to my existing code i mentioned above and say if its an iPad use a certain image that I place? It works great for iPhone but on an iPad it needs to be a different size!!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/19/12 02:06 PM (12 years ago)
If your code allows it (not familiar with Xcode) you would use an else statement, or a else if statement. Fred
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
04/28/12 01:59 PM (12 years ago)
@drmikeb create image for iPad named youriPhoneimage~ipad.png and place it into Image folder.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.