Question

We have white tintColor in whole app.

See on cancel button. Is is white.

enter image description here

How can we change its color?

Was it helpful?

Solution

You can do this by changing [UIBarButtonItem appearance], e.g.:

NSDictionary *textAttributes = @{UITextAttributeTextColor: [UIColor blackColor]};

[[UIBarButtonItem appearance] setTitleTextAttributes:textAttributes forState:UIControlStateNormal];

OTHER TIPS

Try this :-

 UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Title" style:UIBarButtonItemStyleBordered target:self action:nil];
 [barButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateNormal];
 self.navigationItem.rightBarButtonItems = @[barButtonItem]; 

Change title and color according to your requirement.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top