I have this piece of code for an iPad application that works fine for any iOS below iOS 7
UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 75, 44)];
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:2];
UIBarButtonItem *composeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(toggleDelete:)];
[buttons addObject:composeButton];
UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
fixedSpace.width = 5;
[buttons addObject:fixedSpace];
UIBarButtonItem* bi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(touchMe:)];
[buttons addObject:bi];
[tools setItems:buttons animated:NO];
tools.barStyle = -1;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:tools];
[bi release];
[fixedSpace release];
[composeButton release];
[buttons release];
[tools release];
The result of this pre iOS 7 is:
The same code when run on iOS 7 yeilds this result:
For some reason the buttons are moved to the bottom of the Toolbar in iOS 7.
Now, I can reposition them using the UIBarItem imageInset property but that seems to be kind of hackish, because then I need to check for iOS version and only do the imageInset if the iPad's running iOS 7+. My question is am I missing anything specific to iOS 7 pertaining to UIToolbar? I went over the iOS 7 UI Transition Guide and cannot find anything specific to this problem.