1

How are UIBarItems set to blue and red color?

What properties are there for the items to allow this?

some_id
  • 29,466
  • 62
  • 182
  • 304

1 Answers1

2

Well, one property you can set to give a UIBarButtonItem a blue color is to set the style property to UIBarButtonItemStyleDone.

You could set the tintColor property on your UIToolBar which will also tint any UIBarButtonItems in the bar.

Simon Goldeen
  • 9,080
  • 3
  • 36
  • 45
  • +1 for Simon as this is the right way without doing any custom implementation for button... – Sabby Feb 26 '11 at 04:37
  • Thanks, this works nicely. What is the property to get the red button, like delete. – some_id Feb 26 '11 at 04:48
  • The red color you probably need to subclass or use a custom view for. I don't know of a buit-in way to have a button with a color that is not blue or the tint color of the toolbar it is on. The answer to [this SO question](http://stackoverflow.com/questions/4518617/setting-bar-button-item-color-in-a-custom-navigation-bar) has some code in it that might give you a starting point. – Simon Goldeen Feb 26 '11 at 04:56