Discussion Forums  >  Uncategorized

Replies: 8    Views: 247

cyrisneo
I hate code!
Profile
Posts: 12
Reg: Apr 19, 2011
location unknow...
120
12/10/11 08:59 AM (14 years ago)

background nav bar image ios BTv1.5

Has anyone done this? Im trying to figure this out
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/10/11 11:07 AM (14 years ago)
Totally doable. Takes a bit of adjusting after you download your project. Check your email, just sent you an attachment with some step-by-step info
 
cyrisneo
I hate code!
Profile
Posts: 12
Reg: Apr 19, 2011
location unknow...
120
like
12/10/11 03:46 PM (14 years ago)
checking this out thanks for the email..will let you know how it goes.
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
12/10/11 06:37 PM (14 years ago)
Can you pass that info on to GoNorthWest so he can put it up on his btugwiki.com site... May be usefull to other people down the line...
 
cyrisneo
I hate code!
Profile
Posts: 12
Reg: Apr 19, 2011
location unknow...
120
like
12/10/11 06:40 PM (14 years ago)
David sent me for say if you only want a logo. I found a way to replace the whole navbar with a image. However i am currently working to get any buttons to let the background image show through. I will publish howto when I figure it all out.
 
cyrisneo
I hate code!
Profile
Posts: 12
Reg: Apr 19, 2011
location unknow...
120
like
12/10/11 09:48 PM (14 years ago)
place the following code in BT_viewUtilities.m under //is the nav bar hidden? if([[BT_strings getStyleValueForScreen:theScreenData:@navBarStyle:@] isEqualToString:@hidden]){ [theViewController.navigationController.navigationBar setHidden:TRUE]; }else{ [theViewController.navigationController.navigationBar setHidden:FALSE]; } Code Start: 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]; } Code End: Once you place code and set navbarv1.png with you image file name then add image to xcode. this will create a background image for all nav bars in your app. Since the back button is a separate image itself you will change its color to suit your needs. also i believe this code ONLY works for iOS 5 and up.(i haven't tested pre iOS5)
 
timmo26
Lost but trying
Profile
Posts: 10
Reg: Dec 22, 2011
Perth, WA
100
like
01/16/12 05:50 AM (14 years ago)
@David - any chance this could be added as a setting in global themes?
 
fotodog13
Aspiring developer
Profile
Posts: 1
Reg: Feb 04, 2012
Earth
10
like
03/10/12 03:16 PM (13 years ago)
I am wondering if anyone has tried using this since the new upgrade. I have tried to add it and I can't get it to work. If anyone know how to add a header image to the top navbar would love to know ~ could be this code does work and its me ( newbie) Thanks to any and all that can give me a hand fotodog13
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
04/26/12 01:07 AM (13 years ago)
@ fotodog13 Hi there are two missing characters in the code! hi had missing "navbarv1.png" Here is a woking code! 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]; }
 

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.