UITabBarController customisation page top bar colour swift

189 views Asked by At

How do I change the colour of the top bar of the customisation page of the more view controller. Please see the linked image. Sorry I can't post image here because of my low reputation.

Screenshot Image

Edited with more info:

I have managed to change the background color using the following code. But cant change the color of the top bar.

func tabBarController(tabBarController: UITabBarController, willBeginCustomizingViewControllers viewControllers: [AnyObject]) {

    var editView : UIView = tabBarController.view.subviews[1] as! UIView
    editView.backgroundColor = UIColor.blackColor()

}
1

There are 1 answers

5
hardikdevios On

Basically 2 Ways you can achieve this if you are using Global Unique colour in the app for All navigation bar

Use this Solution on App Launch:

UINavigationBar.appearance().barTintColor = UIColor.redColor()

Or if you want to change the Color of More navigationcontroller only then

Use this Solution by getting the Tabbar Reference :

self.tabBarController?.moreNavigationController.navigationBar.barTintColor = UIColor.greenColor()

You can use second solution in the First viewcontroller of the Tab, because that contains your tabbar reference