I have the following code in my viewDidLoad of my containing view:
// Now add the next button
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(self)];
self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor];
self.navigationItem.rightBarButtonItem = nextButton;
The UINavigationController parent has this in viewDidLoad:
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationBar.tintColor = [UIColor whiteColor];
self.navigationBar.barTintColor = [UIColor blackColor];
How do I just customize the rightBar button to change the background color and maybe the text color?
working code.. try this.
You have to set the tintColor property on the button after you assign the button.
instead of
Try below code you can set color of button as well text color
If you wish to have the same color for all bar buttons you can use the following line of code:
in your app delegate.