John Harris John Harris - 1 year ago 93
iOS Question

How can I change the toolbar color in Swift

I'm working on an app and I'm not sure how to change the color of the bottom toolbar in swift. I would like to have it as a custom image to match my navigation bar. Does anyone have a code for that or just to change the color. Thank you

Answer Source

Change background color:

self.toolbar.barTintColor = UIColor.redColor()

Change background image:

self.toolbar.setBackgroundImage(UIImage(named: "BackgroundImage"), forToolbarPosition: .Bottom, barMetrics: .Default)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download