I have a UIToolbar that contains 2 buttons. The toolbar has a tint:
toolbar.tintColor = [UIColor colorWithRed:(102.0/255.0) green:(20.0/255.0) blue:(11.0/255.0) alpha:1];
How can I make the buttons have a similar tint color?
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.
The best thing to do is set the tintColor
AFTER you add buttons to it, as in iOS 4.0, it no longer updates buttons added to the bars after the tintColor
has been set.
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