Question

I've got a strange problem in my application: i've a UIViewController that present an UIAlertView when an user taps on a button. The alert let the user choose between the Photo Library and the iPhone camera.

When the alert shows up, i notice this issue:

First, the UIViewController selected tab bar items has this layout

selected tab bar item

Then, when the alert shows up, it changes like this

selected tab bar item when alert is been shown

And if the user decides to access his photo library and then it returns back, the tab bar item remains like this

selected tab bar after accessing the photo library

How is that possible? Maybe the UIAlertView is changing some tint color?

Thanks

Was it helpful?

Solution

I ran into this problem as well where certain views will sometimes stay dimmed when they should return to their normal color after dismissing a UIAlertView. I believe it is a bug in iOS 7.0 (or possibly 7.1). I put this workaround in my AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
        self.window.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
    }
    return YES;
}

This prevents all views from dimming in the first place, which in turn keeps all your views in your app from staying dimmed.

OTHER TIPS

Are you using a custom UIView subclass? here is what Apple states in the transition guide.

When an alert or action sheet appears, iOS 7 automatically dims the tint color of the views behind it. To respond to this color change, a custom view subclass that uses tintColor in its rendering should override tintColorDidChange to refresh the rendering when appropriate.

I have the same problem with you, but it happens in UISlider. I solved my problem: just set color for my UISlider.

 progressSlider.maximumTrackTintColor = [UIColor lightGrayColor];

I think you just set color for this tab bar item

If you don't set color for tab bar item it will be reset to lightGrayColor after alert is shown

Hope this helps you

Same thing happened to me when I tried to show a UIAlertView in viewDidLoad. I solved this by showing it in viewDidAppear. You can find a sample here https://github.com/Tulakshana/TabBar

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