How can I rearrange UITabBarController items using the Storyboard?
Solution 1
In the storyboard highlight the tab bar controller.
Make sure you are zoomed in enough and that a blue box is around the tab bar controller.
Then click on the tabs and drag them around to where you want them
Solution 2
I solved this by right-clicking on the storyboard -> open as source code, and then rearranged the "segue" xml-blocks in the order I wanted them to be.
Solution 3
xcode 4.5, drag and drop failed. as suggested by another, close xcode and restart xcode. after this drag and drop of tabBarItems worked perfectly to rearrange order.
Solution 4
I could not drag and tabs around while i had the tab bar controller as root view of navigation controller. I had to delete the navigation controller and restart xcode (4.5.2)
Solution 5
Some of the suggestions above worked for me sometimes, but not always. Even rebooting the Mac did not help.
The only way I found that works always is deleting all segues from the tab bar controller to its child view controllers, and reconnecting them in the right order.
Comments
-
itsjavi almost 2 years
Hi I have a UITabBarController in XCode 4.5 as the root controller with many tabs I need to change the order to.
The only thing that works for me is remove the relationships and add them again in the desired order that I want the tabbar items to appear.
Is there another way to do this?
thanks
-
Bazze over 11 yearsWell this doesn't do it for me, I can't rearrange them by dragging and dropping. Has this changed in iOS 6?
-
MobileMon over 11 years@Bazze make sure you are on the tab bar controller and not a view controller for 1 of the tabs
-
Bazze over 11 years@MobileMon I was in the tab bar controller, but it seems like it was some kind of temporary bug. I restarted XCode and now it works just fine.
-
antf over 11 yearsI just faced the same thing and yes it is a bug but you don't need to restart Xcode, just click on any .h or .m file then click back on the story board it should work normally.
-
PJR over 11 yearsthere may be some other issue , did u checked that it is "Zoomed out" enough ?
-
Tom over 11 yearsIt does not work. XCode 4.5.2. Very-very annoying bug, drives me crazy
-
Felipe Plets about 7 yearsShame on Apple that still on Xcode 8.2.1 we still need to open Storyboard as source code and move segues to solve this.
-
manar almost 6 yearsMay sound stupid but clicking the tab item won't highlight it until you try to drag it.
-
dgarbacz about 5 yearsThis worked for me using Xamarin in Visual Studio! Had to close the Storyboard, but opening the file in a text editor and finding what my TabBarController was named, you can easily rearrange based on the order they're in. Save it, re-open in Visual Stuido, worked great! Thanks!
-
Ugo over 3 yearsThis answer worked perfectly for me in Xcode 12.0, thanks.