我有一个 UITabBarController
,它包含 4 个不同的 UIViewControllers
。
在第一个选项卡上有一个UINavigationViewController
,它包含它的子UIViewController
。在不点击标签栏的情况下,我想将用户带到第二个标签上。为此,我尝试了:
self.navigationController.tabBarController.selectedIndex = 1;
但它不起作用。
忽略任何错误,我是新手。
谢谢。
最佳答案
如果设置委托(delegate) 试试这个:
self.selectedIndex = 1;
你是 tabBarController :)
关于ios - self.navigationController.tabBarController.selectedIndex 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10523538/