Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

objective c - Reordering view controllers in a UITabBarController, all defined in a Storyboard

I'd like to change the order of view controllers attached to a UITabBarController, within my Storyboard, without disconnecting all view controllers and reconnecting them in the desired order.

My Question: Can this be done just via the Storyboard IB UI?

Discussion

I'm looking for some inspector panel where I can move items up and down in that list of view controllers that feeds the viewControllers property on UITabBarController.

several view controllers linked to tab bar controller

I've got a lot of tabs and so I'm hoping to not have to disconnect everything and reconnect, just to change the order.

I even tried changing the 'tag' value on the Bar Item, in the inspector, but that value was also ignored at runtime (I believe it is for identification purposes, not for ordering).

Tag set on Bar Item

question from:https://stackoverflow.com/questions/11302095/reordering-view-controllers-in-a-uitabbarcontroller-all-defined-in-a-storyboard

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

enter image description here

you can simply drag and drop and resort them with the mouse in the storyboard. it still works in 4.5.1

EDIT

maybe you have first to switch the storyboard view to "Source Code" and go back before you can drag. right-click the storyboard file and select "Open as" -> "Source Code" and then back again "Open as" -> "Interface Builder - iOS Storyboard". that should do the trick.

EDIT

Does not work in Xcode 4.5.2 anymore for me!

EDIT

In Xcode 5 preview 5 it works again. Seems that Apple did fix this bug in the new verion

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...