我目前有很多viewControllers通过Storyboard与我的tabBarController有关系。给定某些设置,我想以编程方式使某个viewController隐藏或可见。我可以隐藏整个tabBar,但是那不是我想要的。我一直在玩Xcode并搜寻互连网,但找不到解决方案。下面的东西对我不起作用!
[[self.tabBarController.tabBar.items objectAtIndex:2] setHidden:YES];
使用类似的代码来解决此问题。
NSMutableArray *newTabs = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
[newTabs removeObjectAtIndex: 3];
[newTabs removeObjectAtIndex: 2];
[self.tabBarController setViewControllers:newTabs];
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句