Search code examples
iosiphonestatusbar

When my app returns from gallery, it has the navbar's standard colors


my app has a custom dark navigation bar, and on the method Application i put the code:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

but when i came back from an image picker from gallery iOS reuse black color and use it in all the application. Why?


Solution

  • Hi using this method you can manage the navigation bar

     - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
        {
    
            [viewController.navigationItem setTitle:@"Videos"];
            [viewController.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
            [viewController.navigationItem.leftBarButtonItem setTintColor:[UIColor whiteColor]];
            [viewController.navigationItem.rightBarButtonItem setTintColor:[UIColor whiteColor]];
    
            if ([navigationController isKindOfClass:[UIImagePickerController class]]) {
                [[UIApplication sharedApplication] setStatusBarHidden:NO];
                [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
            }
        }
    

    Thanks