iOS 7未満のiOSで正常に動作するiPadアプリケーション用のこのコードがあります
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];
この iOS 7 より前の結果は次のとおりです。
同じコードを iOS 7 で実行すると、次の結果が得られます。
何らかの理由で、ボタンは iOS 7 のツールバーの下部に移動されます。
これで、UIBarItem の imageInset プロパティを使用してそれらを再配置できますが、それはハックのように思えます。iOS のバージョンを確認し、iPad が iOS 7 以降を実行している場合にのみ imageInset を実行する必要があるからです。私の質問は、UIToolbar に関連する iOS 7 に固有の何かが欠けていますか? iOS 7 UI Transition Guide を調べましたが、この問題に固有のものは見つかりませんでした。