Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change 'More' view controller tintColor of UITabBarController?

I have seven UIViews attached to a navigation Controller - Each has an icon as below -

enter image description here

As there are more than 5 pages linked - the tab bar adds a more icon - which when pressed displays a sub page with the further menu options -

enter image description here

enter image description here

The sub page and the subsequent links have a nav bar - which has a blue tint color which I'd like to change to orange to match the rest of the app. My question is how do I style this as it doesn't appear in the storyboard?

like image 497
Dancer Avatar asked Nov 18 '13 15:11

Dancer


People also ask

How do I change the color of my tab bar?

To change tab bar background color in Flutter, first, create a getter to return the TabBar widget and then wrap the TabBar widget inside the PreferredSize -> Material widget. Inside the Material add the color property and set the color of your choice.


3 Answers

You can access that view controller using the moreNavigationController property of UITabBarController.

As you can read in the documentation:

This property always contains a valid More navigation controller, even if a More button is not displayed on the screen. You can use the value of this property to select the More navigation controller in the tab bar interface or to compare it against the currently selected view controller.

Therefore you can do something like

self.tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor orangeColor];
like image 151
Gabriele Petronella Avatar answered Oct 06 '22 08:10

Gabriele Petronella


UIBarButtonItem instances like those in your navigation bar take their tint color from their nearest parent view that has a tint color set. If there isn’t one, they use the default system blue. The iOS 7 UI Transition Guide describes how you can set the tint color for your whole app at once.

The Global Tint menu in the Interface Builder Document section of the File inspector lets you open the Colors window or choose a specific color.

like image 27
Noah Witherspoon Avatar answered Oct 06 '22 10:10

Noah Witherspoon


You can use tabBarController.moreNavigationController.view.tintColor = UIColor(color).

Or in subclass of tabBarController just call self.view.tintColor = UIColor(Color) in viewDidLoad and it will affect more screen and edit screen.

like image 1
P.Zakharov Avatar answered Oct 06 '22 10:10

P.Zakharov