Reputation: 670
I need to center the B item with respect to the toolbar. I create the following in the interface builder:
It works fine until I dynamically insert additional items:
How can I maintain the centralized position of the B item? One idea was to use the Fixed Space Bar Button Items, but I couldn't, because the length of the toolbar changes as well (for different orientations).
Upvotes: 4
Views: 1299
Reputation: 12693
You can use this every time the tab bar change the size:
//lets be tabBar the big view and buttonB the.. well, button B
[buttonB setCenter:CGPointMake(tabBar.frame.size.height/2, tabBar.frame.size.width/2);
Upvotes: 1