0

I have this code, it creates a blue trash can icon on the navigation bar, I want to change the color of this icon to black. how can i do it? Here is my code:

//add trash button to navigation bar
    UIBarButtonItem *myTrash = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemTrash
                                                                             target: self
                                                                            action: @selector(deleteHandler)];

    NSArray* barButtons = [self.navigationItem.rightBarButtonItems arrayByAddingObject: myTrash];
    self.navigationItem.rightBarButtonItems = barButtons;
Vinny
  • 141
  • 1
  • 1
  • 6

1 Answers1

1

You can try changing the tint color of the whole window (Which will help you achieve a consistent color theme):

self.window.tintColor = [UIColor blackColor];

Or the navigation bar's appearance:

[UINavigationBar appearance].tintColor = [UIColor blackColor];

Andy Ibanez
  • 12,104
  • 9
  • 65
  • 100