当我的应用程序从图库返回时,它具有导航栏的标准颜色 [英] When my app returns from gallery, it has the navbar's standard colors

查看:26
本文介绍了当我的应用程序从图库返回时,它具有导航栏的标准颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个自定义的深色导航栏,并且在方法 Application 上我把代码:

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

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

但是当我从 iOS 画廊的图像选择器返回时,重新使用黑色并在所有应用程序中使用它.为什么?

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];
        }
    }

谢谢

这篇关于当我的应用程序从图库返回时,它具有导航栏的标准颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆