In Storyboard, I have a UIToolbar on a UIViewController.
The UIBarButtonItems are:
Left Button / Flexible Button / Nutton 2 / Button 3 / Button 4
On App start the buttons are correctly spaced on the UIToolbar with Left button left-most and Button 2-4 aligned from the right-hand edge of the toolbar.
After a rotation the buttons have not moved so that, in rotating from Portrait to Landscape, there is a lot of space to the right of Button 4.
Am I missing a setting that will automate the relayout? Do I have to add something in the function viewWillTransitionToSize:withTransitionCoordinator
?
The behavior you are hoping for is the normal behavior of a toolbar, as you can easily prove to yourself with a simple clean project containing nothing but a toolbar:
That is a totally nonstandard toolbar, in the sense that you're not supposed to put a toolbar in the middle of its superview like that. But it is pinned exactly as you describe your toolbar to be pinned, with exactly the contents you describe in your question, and it behaves exactly as expected.
Therefore I conclude that you must be doing something else that messes up the behavior of the toolbar, keeping it from doing what it normally does. But you have given no information about what that is, so that is as far as I can go.