更改tabbarcontroller

时间:2015-10-16 08:16:59

标签: ios uinavigationcontroller uitabbarcontroller uinavigationbar

我的UI只是从TabBarController A到TabBarController B,那两个具有不同子项的TabBarController。现在我想更改TabBarController B的导航栏backgroundColor,但是所遵循的任何方法都不起作用。

tabBarViewControllerA.navigationController.navigationBar.backgroundColor = [UIColor yellowColor]; babBarViewControllerB.navigationController.navigationBar.backgroundColor = [UIColor yellowColor]; babBarViewControllerB.childViewControllers.firstObject.navigationController.navigationBar.backgroundColor = [UIColor yellowColor];

此外,从debug->视图调试 - >捕获视图层次结构,我可以看到导航栏backgroundcolor已更改,但最终颜色不会更改。 请给我一些关于这个问题的想法。

2 个答案:

答案 0 :(得分:0)

发现只需要更改navigationbar.bartintcolor

答案 1 :(得分:0)

试试这个。

__init.py__