使用故事板时设置默认选项卡 [英] Setting the default tab when using storyboards
本文介绍了使用故事板时设置默认选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以告诉我如何在iOS中使用故事板时设置默认选项卡。我似乎无法弄清楚如何做到这一点。
Can anyone please tell me how to set the default tab when using storyboards in iOS. I can't seem to figure out how to accomplish this.
谢谢
推荐答案
您可以使用以下两种方法之一:
You can use one of these two methods:
tabBar.items = tabBarItems;
tabBar.selectedItem = [tabBarItems objectAtIndex:0];
或来自对象的直接方法
[tabBar setSelectedItem:myUITabBarItem];
或者您可以将它们组合起来执行此操作:
or you can combine them to do this:
tabBar.items = tabBarItems;
[tabBar setSelectedItem:[tabBarItems objectAtIndex:0]];
但我还没有测试过这种方法,希望这会有所帮助!
but i havent tested that method yet, hope this helps!
这篇关于使用故事板时设置默认选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文