How to tint UIBarButtonItem background color? [duplicate]

I found this solution preferable to those listed here: Tint UIButton and UIBarButtonItem. Unlike the accepted answer, it allows you to change the color of UIBarButtonItems independent of the UINavigationBar.

In case the link goes down in the future, the gist of it is that you create a tinted UISegmentedControl (with UISegmentedControlStyleBar) with one segment, then create a UIBarButtonItem using that as its custom view.

In iOS 5, UIBarButtonItem has a tintColor property.

Leave a Comment