简体   繁体   中英

How can I rearrange UITabBarController items using the Storyboard?

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

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

我通过右键单击故事板 - >打开源代码解决了这个问题,然后按照我希望的顺序重新排列“segue”xml-blocks。

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.

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)

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.

When working with Xamarin iOS Designer, I open the .storyboard file in a text editor and locate the <tabBarController ...> node. Then I rearrange the order of the segues in the <connections> section:

<connections>
    <segue destination="274" kind="relationship" relationship="viewControllers" id="286"/>
    <segue id="943" destination="910" kind="relationship" relationship="viewControllers"/>
    <segue destination="147" kind="relationship" relationship="viewControllers" id="159"/>
</connections>

1) Make sure you are zoomed in enough and that a blue box is around the tab bar controller.

2) Then click on the tabs and drag them around to where you want them.

3) if it is not working , just click on any .h or .m file and then go to storyboard file and try.

4) even though it is not working , just restart xcod and try it.

Click and drag worked for me with Xcode 6.2 with the correct zoom level.

在此输入图像描述

Using Xcode 5 and above you should just drag and drop them:

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM