简体   繁体   English

如何使用Storyboard重新排列UITabBarController项目?

[英]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. 嗨我在XCode 4.5中有一个UITabBarController作为根控制器,我需要将许多选项卡更改为。

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. xcode 4.5,拖放失败。 as suggested by another, close xcode and restart xcode. 正如另一个所建议的那样,关闭xcode并重新启动xcode。 after this drag and drop of tabBarItems worked perfectly to rearrange order. 在此拖放tabBarItems后,完美地重新排列顺序。

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) 我不得不删除导航控制器并重启xcode(4.5.2)

Some of the suggestions above worked for me sometimes, but not always. 上面的一些建议有时对我有用,但并非总是如此。 Even rebooting the Mac did not help. 即使重启Mac也无济于事。
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. 我找到的唯一方法是将标签栏控制器中的所有segue删除到其子视图控制器,并以正确的顺序重新连接它们。

When working with Xamarin iOS Designer, I open the .storyboard file in a text editor and locate the <tabBarController ...> node. 使用Xamarin iOS Designer时,我在文本编辑器中打开.storyboard文件并找到<tabBarController ...>节点。 Then I rearrange the order of the segues in the <connections> section: 然后我重新排列<connections>部分中segue的顺序:

<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. 1)确保放大得足够,并且标签栏控制器周围有一个蓝色框。

2) Then click on the tabs and drag them around to where you want them. 2)然后单击选项卡并将它们拖动到您想要的位置。

3) if it is not working , just click on any .h or .m file and then go to storyboard file and try. 3)如果它不工作,只需点击任何.h或.m文件,然后转到故事板文件并尝试。

4) even though it is not working , just restart xcod and try it. 4)即使它不工作,只需重新启动xcod并尝试它。

Click and drag worked for me with Xcode 6.2 with the correct zoom level. 使用Xcode 6.2以正确的缩放级别单击并拖动为我工作。

在此输入图像描述

Using Xcode 5 and above you should just drag and drop them: 使用Xcode 5及以上版本,您只需拖放它们即可:

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 StoryBoard 在 UITabBarController 中设置选定的选项卡? - How do I set selected tab in UITabBarController using StoryBoard? iOS / xcode-如何从UITabBarController打开新的情节提要,并防止UITabBar消失? - iOS/xcode - How can I open a new storyboard from UITabBarController and keep the UITabBar from disappearing? 如何为UITabBarController中包含两次的同一情节提要板设置不同的UITabBarItems? - How can I set different UITabBarItems for the same storyboard reference included twice in a UITabBarController? 我可以在UITabBarController中添加UITabBarController吗? - Can I add UITabBarController in UITabBarController? 如何更改UITabBarController中的项目 - How to change items in UITabBarController 故事板 - UITabBarController - Storyboard - UITabBarController 使用 storyboard 和自定义 UITabBarController 显示警报 - Display an alert using storyboard and custom UITabBarController 为什么一个故事板包含一个UITabBarController不能显示另一个故事板/ - Why a storyboard contain a UITabBarController can't present another storyboard/ 如何在UITabBarController中显示ViewController? - How can I show ViewController in UITabBarController? 故事板-如何在UINavigationController中使用UITabbarController自定义UITabbarItem - Storyboard - How to custom UITabbarItem with UITabbarController inside UINavigationController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM