0

我的用戶界面只是從TabBarController A到TabBarController B,這兩個TabBarController具有不同的子項。現在我想更改TabBarController B的導航欄backgroundColor,但是其中的任何方法都不起作用。更改tabbarcontroller的導航欄backgroundcolor

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

此外,從調試 - >視圖調試 - >捕獲視圖層次結構,我可以看到導航欄backgroundcolor已更改,但最終的顏色不變。 請給我一些關於這個問題的想法。

回答

0

發現,只需要改變navigationbar.bartintcolor

0

嘗試與此有關。

self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];