Andy
Andy

Reputation: 105

Alternative to setTintColor for pre-iOS5 UIBarButtonItems?

are there any alternatives to using the accessor setTintColor for UIBarButtonItems in order to add ios4 compatibility?

is it possible to modify the setter to include a conditional statement for systemVersion (without subclassing UIBarButtonItem)?

Upvotes: 1

Views: 657

Answers (1)

xizor
xizor

Reputation: 1614

There are three approaches to do this. First, is to draw a button with CoreGraphic. Second, use a custom image. The third approach is probably the easiest and allows you to use a tintColor property for dynamic changes if wanted.

The idea is to create a UISegmentedControl and stylize it to look like a button and use that tintColor property to change the color of the "button".

You can find specific details at this webpage http://charles.lescampeurs.org/2011/02/10/tint-color-uibutton-and-uibarbuttonitem .

Upvotes: 1

Related Questions