I'm adding a MKUserTrackingBarButtonItem
to a toolbar. This works fine on iPhone, but on iPad the button will only use the "plain" style. This makes it almost invisible on a black toolbar, so I want to use the bordered style. But even setting the item's style
property to UIBarButtonItemStyleBordered
makes no difference - it always renders on iPad as if using UIBarButtonItemStylePlain
For completeness, this is the code I use to add the button:
MKUserTrackingBarButtonItem *userTrackingButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
NSMutableArray *toolbarItems = [[NSMutableArray alloc] initWithArray:[[self toolbar] items]];
[toolbarItems insertObject:userTrackingButton atIndex:0];
[self.toolbar setItems:toolbarItems];
Here's how it looks on iPhone (right):
And on iPad (wrong):
Tested on iOS 6.1, with a plain UIToolbar. I know UIToolbar on iPad can show bordered toolbar items, because it works for normal buttons, like this one, but I just can't get the user tracking button to do the same: