I have a segmented control. Whenever the view has finished appearing I create a bar button item to hold it and set that as the toolbars item. The problem I'm having is that the segmented control will not fill up the space in the toolbar, even though it is set to have space-filling behaviour.

How can I have a space-filling segmented control in a toolbar in an iOS app?