Pregunta

We have white tintColor in whole app.

See on cancel button. Is is white.

enter image description here

How can we change its color?

¿Fue útil?

Solución

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

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

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

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top