gpt4 book ai didi

iphone - 通过代码更改选定的 TabBarItem?

转载 作者:行者123 更新时间:2023-11-29 04:41:47 26 4
gpt4 key购买 nike

我想知道您将如何通过代码更改 UITabBar 的选定选项卡?

是的,我知道这个帖子是以下内容的副本: Objective C: How to switch from one Tab bar to another via program但该解决方案不起作用。

谢谢!

-Shredder2794

最佳答案

这适用于您的情况吗?

[tabBar setSelectedItem:[[tabBar items] objectAtIndex:index]];

[tabBarController setSelectedIndex:index];

关于iphone - 通过代码更改选定的 TabBarItem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10274609/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com