是否可以更改/替换 UITabBarController 中选项卡之一的 ViewController(和 View)?
我想从特定选项卡以任意顺序在 3 个不同的视图控制器之间切换(这就是导航控制器不可能的原因)。
它们是使用 setViewControllers:animated: (批量)设置的,所以你可以做这样的事情。
// Assume tabController is the tab controller
// and newVC is the controller you want to be the new view controller at index 0
NSMutableArray *newControllers = [NSMutableArray arrayWithArray:tabController.viewControllers];
[newControllers replaceObjectAtIndex:0 withObject:newVC];
[tabController setViewControllers:newControllers animated:YES];
希望有帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)