I have seven UIViews attached to a navigation Controller - Each has an icon as below -
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 -
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?
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.
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];
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With