views:

748

answers:

1

Hi

I was wondering why everything stops behaving as it should when I do something like this:

self.navigationController.navigationBar.tintColor = [UIColor blackColor];

All my buttons on the navigationBar are now black regardless of style, like this one below, it should turn up as a blue button:

    UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleDone target:self action:@selector(editTrip)];

It does not, it is just black.

The slight change/effect in the button when tapped is also gone?

Is there a way to change the color of the navigationBar and maybe even the UIbarButtonItems without somehow ruining standard behavior?

This is really strange. I just checked with the Apple "Remote" app, it has the black navigation bar and a blue "Done" button for leaving the "help" section.

Do I really have to build everything custom to achieve this?

Thanks for any help given:)

+2  A: 

In Interface Builder, change the Style of the Navigation Bar to Black Opaque or Black Translucent and leave the tint alone. This will give you a black bar with the standard blue buttons.

I'm sure the way to do this in code without Interface Builder, is by setting the barStyle property to UIBarStyleBlack or UIBarStyleBlackTranslucent, but I haven't done it that way.

mahboudz
Hi mahboudzThanks I'll try that right away. I was wondering if the tint where being applied to every subview, it seems like it:)I'll be setting these thing in code so will just get back with the results.
RickiG
Perfect mahboudz! self.navigationController.navigationBar.barStyle = UIBarStyleBlack;Get's me both the black look and the right colored buttons:)Thanks again!
RickiG
Great! Good luck...
mahboudz