SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
02/01/15 05:32 AM (9 years ago)

Custom NavBar Fonts in iOS8, Status Bar, Font Colors... Misc Rambling...

Lessons learned about the status bar: You only have TWO choices for the status bar - light, and dark. Which means black, or white. You can have any color you wish, as long as those colors are black, or white. They can be translucent. This is 'adjustable' in your control panel. Look under 'theme'. If you need to hard code it, you can do this in your appDelegate file, around line 78 or so. A couple of things about custom navbar fonts and colors in iOS8: To change the color of the NavBar (and StatusBar) Background, do so in your control panel. You can also hard code it in BT_viewController, around line 184. If you're going to use an image, I suspect this is the area you'll want to work in. But I haven't bothered with images. To change the color of the font in the NavBar, alter line 90-ish of your appDelegate file. If you change the font, you have the option to use a 'different' color. So, you could have the refresh button be blue, and the NavBar text red. You would change the font in the BT_viewController.m file, 'around' line 382 or so, after it says 'end setup NavBar'. Copy and paste this, altering values to suit your needs: // start code NSShadow *shadow = [[NSShadow alloc] init]; shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8]; shadow.shadowOffset = CGSizeMake(0, 1); UIColor *myColor = [BT_color getColorFromHexString:@"#330033"]; // <-- can be diff from current navbar font color NSDictionary *textola = [NSDictionary dictionaryWithObjectsAndKeys: myColor, NSForegroundColorAttributeName, shadow, NSShadowAttributeName, [UIFont fontWithName:@"chalkduster" size:21.0], NSFontAttributeName, nil]; [self.navigationController.navigationBar setTitleTextAttributes:textola]; // end code I think that's it. I need to alter my 'custom font' documentation. When I do I'll submit it to Susan for publishing, and let you know when it's available. In the meantime, earmark these notes in your favorite snippet library. Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/01/15 10:18 AM (9 years ago)
Sounds cool. Are these specific to iOS 8, or will changes also work for iOS 7?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/01/15 03:27 PM (9 years ago)
You know NC, I'm not really sure. I was just working on iOS8, and was getting frustrated at it's stuborness. There are a few iOS7 threads about NavBar, but since they weren't working, I suspect not, but I can't say that with authority until some thorough testing is done. This was posted late last night and I was happy to get it to work, but kind of tired, lol! Cheers! -- Smug OK, I'm sure. I just tried it on my iPhone 4 using iOS 7.1.2, and it works just dandy.
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
02/14/16 03:06 AM (8 years ago)
The issue I am facing is how to change the iOS "battery meter & provider" text to white. On one of my apps I found the code and got it done, but I failed to save the snippet and info of how I did that, and now I cannot for the life of me figure out how I did it! Can anyone help me?
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
02/14/16 03:19 AM (8 years ago)
Found it! 1. add this to AppDelegate.m: [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 2. (THIS IS USUALLY ALREADY SET OUT OF THE BOX:) Info.plist -> set View controller-based status bar appearance to NO
 

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.