views:

30

answers:

1

I have a UIView that I am loading and it has a navigation bar with a 'Done' barButton. When I leave the navigation bar the default color, everything is fine. When I make it have a black tint, the 'Done' button works fine but it does not have the pressing animation that buttons usually have. It doesn't look as thought the button is being pressed. Does anyone know why this is?

self.navigationController.navigationBar.tintColor = [UIColor blackColor];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] 
                                           initWithTitle: NSLocalizedString(@"Done", @"")
                                           style:UIBarButtonItemStyleDone
                                           target:self 
                                           action:@selector(donePressed:)] 
                                          autorelease];

Thank you so much!

A: 

[UIColor blackColor] does not supply a second color for the push effect. Your best best bet is to use darkGreyColor on the navigationBar or if you really need black then you'll have to animate this yourself.

I've heard that the reason black doesn't have a second color is because there is no color darker than black.

AWinter
haha - yeah, I guess that makes sense. Sometimes when the bar is black though, the unpressed button is a lighter grey and it turns black on press. Maybe its the order in which I add the button and turn the bar black so I'll look into that. Thanks for your help
Rossi