Fix UIImagePickerController secretly changing StatusBar color

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{   
    // bug fixes: The problem of changing the color of StatusBar while using UIIMagePickerController
    if ([navigationController isKindOfClass:[UIImagePickerController class]] &&
        ((UIImagePickerController *)navigationController).sourceType ==     UIImagePickerControllerSourceTypePhotoLibrary) {
        [[UIApplication sharedApplication] setStatusBarHidden:NO];
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
    }
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326757039&siteId=291194637