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

时光毁灭记忆、已成空白 提交于 2019-12-12 02:37:59

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/21573388/when-my-app-returns-from-gallery-it-has-the-navbars-standard-colors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!