I'm having a very odd problem with tint color in iOS7.
When the ViewController that I'm having trouble with first loads, all of the tint is a light gray color, as if everything is inactive or behind a UIAlertView that has dimmed the screen. The buttons are still active and work just fine, but they are all gray. (I have the tint color set to orange, more on that in a bit).
Here's the odd part. If I present, and then immediately dismiss another ViewController, all of the orange tint appears and everything works as expected. That is the only way I have been able to get the tint to appear - nothing else seems to work.
I'm using the same basic code patterns throughout the app, and this problem really only affects one ViewController. This particular ViewController is presented UIModalPresentationFullScreen
, and UIModalTransitionStyleCoverVertical
, if those matter at all.
Here's how I'm setting tinting:
First, I have set a tint color on each view controller within interface builder, these settings are the same across both working and problematic VCs.
Next, I have set a tint color globally in my App Delegate like this:
[_window setTintColor:[UIColor orangeColor]];
The above two work on most of my ViewControllers, but not on all of them for some reason. For the ones that it was not working on, I've been using a handful of different techniques to get the tint color to work. For example:
self.view.tintColor = [UIColor orangeColor];
or
[_myUIBarButtonItem setTitleTextAttributes:
[NSDictionary dictionaryWithObject:[UIColor orangeColor]
forKey:NSForegroundColorAttributeName]
forState:UIControlStateNormal];
or to force a tintColor update:
[_myButtonOutlet setTitleColor:_cancelButtonOutlet.tintColor
forState:UIControlStateNormal];
Any ideas?