Unable to create bordered MKUserTrackingBarButtonItem
| Originator: | eromijn | ||
| Number: | rdar://13331434 | Date Originated: | 02-Mar-2013 10:51 AM |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 6.x |
| Classification: | Other bug | Reproducible: | Always |
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
Steps to Reproduce:
- Create a new single view iPad project
- Add the MapKit framework
- Add a map to the view, add an outlet to the ViewController
- Add a toolbar to the view, remove the button, add an outlet to the ViewController
- Configure ViewController's viewDidLoad as:
- (void)viewDidLoad
{
[super viewDidLoad];
MKUserTrackingBarButtonItem *userTrackingButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
userTrackingButton.style = UIBarButtonItemStyleBordered;
[self.toolbar setItems:[NSArray arrayWithObject:userTrackingButton]];
}
Set the toolbar to black opaque, and the problem should be clear: the button is almost invisible to the user, because it uses plain and not bordered style.
Expected Results:
It should look similar to the MKUserTrackingBarButtonItem on iPhone: http://i.stack.imgur.com/NomOi.png
And I know iPad UIToolbar can display bordered items, because it works for this manually created button:
http://i.stack.imgur.com/lbeQL.png
Actual Results:
It always displays as if it had UIBarButtonItemStylePlain: http://i.stack.imgur.com/hAiCc.png
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!