Alexandru Dranca
Alexandru Dranca

Reputation: 830

UINavigationItem setTint Bug?

I think this is a bug with the way apple is changing the tint color:

This is the code that i am using :

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismiss)];
self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];

and later, on button tap :

[UIView animateWithDuration:1 animations:^{
    self.navigationItem.leftBarButtonItem.tintColor = nil;
}];

Doesn't matter what color i put there, the effect is same.

The undesired effect

Upvotes: 0

Views: 49

Answers (1)

spacecash21
spacecash21

Reputation: 1331

Have you tried setting colors for diferent states?

[[theNavigationBar.subviews objectAtIndex:1] setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[[theNavigationBar.subviews objectAtIndex:2] setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

Upvotes: 1

Related Questions