Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道您将如何通过代码更改 UITabBar 的选定选项卡?
是的,我知道该线程是以下内容的副本: 目标 C:如何通过程序从一个标签栏切换到另一个标签栏, 但该解决方案不起作用。
谢谢!
-碎纸机2794
这对你的情况有用吗?
[tabBar setSelectedItem:[[tabBar items] objectAtIndex:index]];
或者
[tabBarController setSelectedIndex:index];