iosimageuiwebviewios7-statusbar

ios 7 - choosing photo from gallery resets statusBarStyle


I have an iOS 7 app and I have set the status bar text to white in didFinishLaunchingWithOptions as follows:

 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

I have a webview with a javascript that calls the native Image Picker. In the Image Picker, when I choose a Photo from the Gallery, the status bar text is reset to black.

One way to correct this is to apply the above code again when the Image Picker closes. However, I cannot detect this event since it is on the webview.

Any idea how to fix this?


Solution

  • I solved it by implementing this:

    -(void) viewDidAppear:(BOOL)animated
    {
    
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    
        [super viewDidAppear:animated];
    
    }
    

    As soon as the Photo Gallery closes, this code is called.