4

I am using the appearance proxy to adjust my color settings globally:

//Setup custom appearances
    if ([UINavigationBar respondsToSelector:@selector(appearance)]) {
        [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"header"] forBarMetrics:UIBarMetricsDefault];
        [[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:96.0/255.0 green:13.0/255.0 blue:11.0/255.0 alpha:1.0]];
        [[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:96.0/255.0 green:13.0/255.0 blue:11.0/255.0 alpha:1.0]];
        //rgb: 96, 13, 11
        //[[UIToolbar appearance] setBackgroundImage:[UIImage imageNamed:@"header"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
        [[UIToolbar appearance] setTintColor:[UIColor blackColor]];
    }

This works fine, but when I tap on a UIBarButtonItem that is in my UINavigationbar, it changes color to black. How can I make sure the highlighted state is not black?

Sheehan Alam
  • 58,693
  • 123
  • 352
  • 554
  • This post should help you http://stackoverflow.com/questions/664930/uibarbuttonitem-with-color – Mason Jan 24 '12 at 01:45

2 Answers2

1

last line is:

[[UIToolbar appearance] setTintColor:[UIColor blackColor]];

maybe rem it?

theWalker
  • 2,014
  • 1
  • 18
  • 26
0

Check this out: UIBarButtonItem with color?

Make sure that you import "QuartzCore/QuartzCore.h" in order to access the layer properties of UIView. To import that, you need to have added the CoreGraphics framework to your project.

Community
  • 1
  • 1
Mason
  • 6,553
  • 15
  • 70
  • 114