-1

I have a done button on navigation bar, I want to have it shown as blue. But just doing the following seems doesn't help. What am I missing here? I know that if the navigation bar is in black color, the button will be shown as blue automatically, but I don't want the color of the navigation bar on this view controller to be black.

- (UIBarButtonItem *)doneButton {
    UIBarButtonItem *doneButton = [[[UIBarButtonItem alloc] initWithTitle:@"Done" 
                                                                    style:UIBarButtonItemStyleDone 
                                                                   target:self 
                                                                   action:@selector(done:)] autorelease];

    return doneButton;
}
tom
  • 14,273
  • 19
  • 65
  • 124

2 Answers2

0

You don't need to define your own done button. As long as it's called 'done' you can use the predefined barbuttonsystemitemdone:

   [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone Target:...
Kris Van Bael
  • 2,842
  • 1
  • 18
  • 19
0

Changing combination of NavigationBar and BarItems appearance is not easy tasks before iOS5.

Standard way is to subclass NavigationBar. This nice sample code may help, even if not directly.

In iOS5, you can use "appearance proxy". Nice tutorial is here

barley
  • 4,403
  • 25
  • 28