0

In my app delegate I have this:

UIColor* color = [UIColor colorWithRed:36/255.0f green:38/255.0f blue:56/255.0f alpha:1.0f];
[[UIBarButtonItem appearance] setTintColor:color];

I'd like to have another color set for the pressed state.

How do I achieve this without using a background image?

Pieter
  • 1,751
  • 3
  • 30
  • 65
  • Try this link for your answer post : http://stackoverflow.com/questions/4012664/uibarbuttonitem-highlighted-color Thanks..! – Dinesh Apr 27 '12 at 10:36

1 Answers1

0

The UIBarButtonItem don't have different states. However the UIButton do. So you might want to put an ordinary Button in your navigation bar or toolbar and then use different background images per state, which is possible for UIButton or you use the Highlight Tint property if you just want to change the tint for the highlighted state.

If you use an image for the different states, then you get to define an image for those states:

  • Default
  • Highlighted
  • Selected
  • Disabled

See this SO post: UIButton as UINavigationbar button

Community
  • 1
  • 1
Besi
  • 22,579
  • 24
  • 131
  • 223