Discussion Forums  >  Status Bar, Navigation Bar

Replies: 15    Views: 278

Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
01/09/13 06:40 AM (11 years ago)

How do change color right button in nav?

hi BT forums can you tell me how i can change color right button in nav ios app ? thank you so much !
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/09/13 07:37 AM (11 years ago)
Hey @Black White, I believe its on the same page as adding it. If not click on the name of the screen and see if it's there. LA
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
01/09/13 08:21 AM (11 years ago)
hi @LA, so can change right button nav same nav + back button color?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/09/13 08:31 AM (11 years ago)
I was taking about the Nav. Bar color. LA
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
01/09/13 08:49 AM (11 years ago)
yeah, i know but "info light" button do you know how can change color for it ?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/09/13 09:14 AM (11 years ago)
I will have to look into it. Not sure off the top of my head. You using Android or IPhone? I believe it just goes by the color of Nav. Bar. LA
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/09/13 09:52 AM (11 years ago)
As you said iOS, I have code for you To change all the uibarbutton items , which is the left and right navigation buttons, and the refresh button. add this code in the view will appear method of every plugin you want (e.g BT_screenBlank) under //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self:[self screenData]]; so it will override the control panel . NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], // text color UITextAttributeTextColor, [UIColor clearColor], UITextAttributeTextShadowColor, nil]; [[UIBarButtonItem appearance] setTitleTextAttributes: attributes forState: UIControlStateNormal]; [[UIBarButtonItem appearance] setTintColor:[UIColor redColor]]; // Button color If you only want to change the right button add NSDictionary *rightAttributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], // text color UITextAttributeTextColor, [UIColor clearColor], UITextAttributeTextShadowColor, nil]; [self.navigationItem.rightBarButtonItem setTitleTextAttributes:rightAttributes forState:UIControlStateNormal]; [self.navigationItem.rightBarButtonItem setTintColor:[UIColor blueColor]]; //Button color The reason I added the text color option is just in case the white text blends into your navbutton colour. Bare in mind this will change the colours of the on every screen with this plugin only. If you only wanted it on one screen of one plugin you would need an if statement.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/09/13 10:55 AM (11 years ago)
you cannot change the color of an info light/ info dark. They are integrated ios images. If that is the look you are going for you would have to create a custom button, again this is easy enough but personally have struggled to get it to work with the control panel and had to hard code it's method.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/09/13 02:30 PM (11 years ago)
Did it work
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
01/10/13 03:47 AM (11 years ago)
hi @Kittsy thank for your tips you mean in BT_viewUtilities.m ? but i cant search where is: //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self:[self screenData]]; for override NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], // text color UITextAttributeTextColor, [UIColor clearColor], UITextAttributeTextShadowColor, nil]; [[UIBarButtonItem appearance] setTitleTextAttributes: attributes forState: UIControlStateNormal]; [[UIBarButtonItem appearance] setTintColor:[UIColor redColor]]; // Button color
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/10/13 03:53 AM (11 years ago)
Sorry I'm bad I missed the line where to put it, This will go in the view will appear in the .m file of every plugin (BT_screenBlank.m in your plugins folder) you want it to be in. You see I use this code to highlight certain buttons, but I wouldn't want all of them to look like that, do you get what I mean? If you want a more global option, for every screen, I'll post that tonight. But for now put them lines of code in each plugin and it will work
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
01/10/13 04:05 AM (11 years ago)
hi @Kittsy im glad your help in my app use nav bar images, i want make: back, fresh, right nav button with images transparent so can you help me how to add images on nav button ? thank you so much
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/10/13 04:20 AM (11 years ago)
That is a tad more complicated getting them to communicate with the control panel. It is doable, I'll put that on my list for when I get home. Are you self hosted?
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
01/10/13 04:23 AM (11 years ago)
i use BT control panel
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
02/09/13 01:01 PM (11 years ago)
Hi Kittsy not sure if you will reply as the post is old, but I have added the code above to my screens of choice, but the left button text won't change colour and remains black, no matter what. Is there somewhere else I need to change the settings for this?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/09/13 01:12 PM (11 years ago)
I'm away from the mac, I'll post back with the change I'm sure it worked last time
 

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.