سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top