3

Using XCode 5 targeting minimum OS of IOS6 I create the bar button item like this

self.navigationItem.rightBarButtonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];

And then set its tint like this

self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f];

When I deploy to an IOS6 devive the bar button item is correctly tinted, but on an IOS7 device it remains the stock blue

Is this an issue others have experienced? An XCode 5 bug?

Help?

Thanks

Piginhat
  • 131
  • 9
  • I'd suggest using a different (default) bar button item and seeing if the problem is still there. If so, something weird is going on. If not, it's probably a bug in `MKUserTrackingBarButtonItem`. – Scott Berrevoets Dec 02 '13 at 22:18

3 Answers3

4
MKUserTrackingBarButtonItem *buttonItem = [[MKUserTrackingBarButtonItem alloc]    initWithMapView:self.mapView];    
[buttonItem.customView setTintColor:[UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f]];
eddieA
  • 41
  • 2
2

I have not found a solution to this as well but I know changing your default window color will override it. If you don't mind your default window color being overridden you made the following to your app delegate's didFinishLaunchingWithOptions method.

self.window.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f];
Jon Erickson
  • 1,876
  • 4
  • 30
  • 73
1

From Apple Documentation :

In iOS 6, tintColor tinted the background of navigation bars, tab bars, toolbars,search bars, and scope bars. To tint a bar background in iOS 7, use the barTintColor property instead.

iOS 7 Transition Guide

Nikhil Patel
  • 1,761
  • 12
  • 23
  • 2
    alas no. my question relates to barbuttonitems not the background of the navigationbar. page 23 of the guide states use tintColor to tint barbutton items. as my question states I am doing this – Piginhat Sep 26 '13 at 19:46