简体   繁体   中英

Changing the colour of Navigation Controller bottom toolBar

I am trying to change the colour of the bottom bar of my Navigation Controller. I have managed to change the top NavBar in my appdelegate by adding

[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.688 green:0.437 blue:0.794 alpha:1.0]];

I want to apply this to the bottom bar also.

You can use [UIToolbar appearance] to set the appearance of UIToolbar

Good luck

I had the same problem, but could escape this by setting a tag for my navigationBar in my storyboard. Then I could change the navigationBar's color like this:

let navigationBar = (self.view.viewWithTag(someNumber) as UINavigationBar) navigationBar.barTintColor = UIColor.blackColor()

This is not ideal unless you can guarantee that the number of subviews in your view is less than "someNumber". If you can though, then this should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM