Discussion Forums  >  iOS / Android Beta Testers

Replies: 26    Views: 2596

Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
06/12/13 07:52 AM (10 years ago)

iOS 7 Nav Bar Color Fix

Hi All, This is a fix for the iOS 7 Nav Bar. -Go to BT_application.m file, find "//set the background color of the navigation bar" (based on my initial findings, you only need to change the first one around line 477) -For the first one, add the following code: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Check if device is running iOS 7 float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { //set the background color of the navigation bar [[rootNavController navigationBar] setBarTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } else { //set the background color of the navigation bar [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Recompile Note: You will see a warning when compiling in Xcode 4, do not worry about this, as this will never be accessed because Xcode 4 can only compile for iOS 6.X Jake
 
Cakebit
Code is Art
Profile
Posts: 500
Reg: Dec 15, 2010
In your local b...
16,500
like
06/12/13 08:03 AM (10 years ago)
I was just looking for this fix :) Nice!
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/12/13 08:15 AM (10 years ago)
Awesome Jake! Quick thing however, would this problem be temporary for the beta? - unless they planned to completely unsupported tints? Also wondering if this fix will be incorporated into the buzztouch core files so we won't have to do this if it does turn out to be permanent. So many questions! David https://buzztouchmods.com
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/12/13 08:20 AM (10 years ago)
Edit: judging from this code they did not "un-support" tints, simply changed the call method. Ha. Answered my own question. David https://buzztouchmods.com
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
06/12/13 08:27 AM (10 years ago)
@MrDavid: Have you tried to compile under Xcode 5. The apps look really cool! Jake
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/12/13 08:28 AM (10 years ago)
@jake do you have both 4.5.2 and xcode 5 installed? if so, how did you do it?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/12/13 08:30 AM (10 years ago)
Not yet! I've avoided it because you can't submit apps with it. Same as mysps, any way to have them both installed? I'd like to check out this new interface you're talking about! David https://buzztouchmods.com
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
06/12/13 08:31 AM (10 years ago)
@Everyone: I have both installed. Installing Xcode 5 DP can run on the same machine as Xcode 4. Jake
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/12/13 08:43 AM (10 years ago)
cool! but how?
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
06/12/13 09:41 AM (10 years ago)
I just downloaded the Xcode 5 package, installed it, and both work seamlessly. Jake
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
06/12/13 06:44 PM (10 years ago)
That is sweet. Thanks for that info.
 
tgajeski
Aspiring developer
Profile
Posts: 1
Reg: Jul 19, 2013
Green Bay
1,110
like
07/22/13 01:02 AM (10 years ago)
Anyone else getting an error when attempting to complie? "! Use of undeclared identifier 'theScreen'; did you mean 'UIScreen'?"
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
07/26/13 07:05 AM (10 years ago)
If you try to compile this code in Xcode 4.6.3, it will not load. This code only works in Xcode 5 to support older operating systems. If you try to compile in Xcode 4.6.3, it will not know what "theScreen" is. Jake
 
Stevarino
Aspiring developer
Profile
Posts: 15
Reg: Aug 26, 2012
USA or Philippi...
10,650
like
09/12/13 07:40 PM (10 years ago)
That makes sense to me. Thanks Jake for your input. I'm learning alot here.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/20/13 05:27 PM (10 years ago)
I'm using Xcode 5.0 (official release, not beta), and Xcode still gives the ""! Use of undeclared identifier 'theScreen'; did you mean 'UIScreen'?"" error. Any ideas?
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
10/03/13 01:02 PM (10 years ago)
Thank you, Jake! I owe you one. I have an app that has to be submitted right away and I can't wait for the new core.
 
Chris from Staffor...
Aspiring developer
Profile
Posts: 335
Reg: Oct 14, 2013
Stafford
5,750
like
10/31/13 11:08 AM (10 years ago)
I had same error as Angry Ninja, so have undone the paste and reverted back until solution is found Any one got it yet?
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/16/13 01:46 PM (10 years ago)
I just had the same issue with the navbar colour not changing. I did the fix suggested above which worked great for the navbar colour but now my refresh and back buttons in the navbar don't show up at all. When I press the spot where the back button was suppose to be it works, but it just doesn't show up. I changed the navbar colour to see if maybe it was blending in but that's not the case. Any possible suggestions? Cheers, Ewa
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
12/16/13 03:27 PM (10 years ago)
It is probably showing up, but it is the same color. If you change the color of one, the other may change. Have you downloaded a v3 project? (This big should have been fixed) Jake
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/16/13 05:05 PM (10 years ago)
I've changed the navbar colors and still have the same issue. The navbar buttons show up if I don't use the fix above but soon as I do they disappear, yet buttons remain active. I thought the issue was the colors being the same as well but its not. Yes, it's a v3 project. Is there anyway to change the color of the navbar buttons? I'm new to any coding and app building so I may be messing something up. Not sure what else to try. Ewa
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
12/17/13 08:04 AM (10 years ago)
Yes, you can use this: [[rootNavController navigationBar] setTintColor:[UIColor redColor]; Does this change the color to red? You can substitute redColor for any of these: http://jakeserver.com/Uploads/Images/iOS_UI_Color.png Does this help? Jake
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/17/13 04:30 PM (10 years ago)
Sorry Jake don't want to keep bugging you but I don't know ANYTHING about coding. Where exactly do I paste that line into?
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
12/18/13 08:08 AM (10 years ago)
@PolskaPolka: It is totally ok. If you have used: //Check if device is running iOS 7 float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { //set the background color of the navigation bar [[rootNavController navigationBar] setBarTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } else { //set the background color of the navigation bar [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } Then paste it right under: [[rootNavController navigationBar] setBarTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; Jake
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/18/13 06:42 PM (10 years ago)
Hi, I tried the solution above but soon as I paste it under that code it gives me the following error " Parse issue Expected ']' " Here is the code that I have in there. Did I paste it maybe in the wrong spot? I tried different spots and still didn't work. //set the background color of the navigation bar //Check if device is running iOS 7 float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { //set the background color of the navigation bar [[rootNavController navigationBar] setBarTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } else { //set the background color of the navigation bar [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; [[rootNavController navigationBar] setTintColor:[UIColor redColor]; rootNavController.view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [rootNavController setDelegate:self]; }else{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"The application does not have any screens?%@", @""]]; } }//end singleNavController
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
12/19/13 08:11 AM (10 years ago)
Ok, sorry. I had a typo. This is coming from the line I posted above. The corrected line should be [[rootNavController navigationBar] setTintColor:[UIColor redColor]]; Does this work? Jake
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/19/13 04:21 PM (10 years ago)
Hi, Not sure what's wrong, still doesn't work. I notice there are 2 lines that say [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; I tried pasting the line you gave me under the first one, then the second line, then both and it still doesn't work. //set the background color of the navigation bar //Check if device is running iOS 7 float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { //set the background color of the navigation bar [[rootNavController navigationBar] setBarTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; [[rootNavController navigationBar] setTintColor:[UIColor redColor]]; } else { //set the background color of the navigation bar [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; } [[rootNavController navigationBar] setTintColor:[BT_viewUtilities getNavBarBackgroundColorForScreen:theScreen]]; rootNavController.view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [rootNavController setDelegate:self]; }else{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"The application does not have any screens?%@", @""]]; } }//end singleNavController
 
PolskaPolka
Lost but trying
Profile
Posts: 15
Reg: Dec 06, 2013
Winnipeg
3,050
like
12/20/13 07:37 PM (10 years ago)
Hey Jake, thanks again for your help. I found this code online and it seems to work, not sure why this one. UIBarButtonItem *barButtonAppearance = [UIBarButtonItem appearance]; [barButtonAppearance setTintColor:[UIColor blackColor]]; Thanks again, Ewa
 

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.