简体   繁体   English

隐藏Xcode上的标签栏项目

[英]Hiding tab bar items on xcode

So i have a tab bar controller linked to 4 different view controllers. 所以我有一个标签栏控制器链接到4个不同的视图控制器。 My first viewcontroller (First page that pops up during simulation) is my login page. 我的第一个viewcontroller(模拟过程中弹出的第一页)是我的登录页面。 I just want to hide the tab bar items before logging in and after the right login details have been entered re-enable the tab bar items to be accessible. 我只想在登录之前隐藏标签栏项目,并在输入正确的登录详细信息后重新启用标签栏项目即可访问。 I have read other related questions in this site however i can't seem to find a simple solution. 我已经在该网站上阅读了其他相关问题,但是我似乎找不到简单的解决方案。 I thought the coding would be as easy as hiding images or labels. 我认为编码就像隐藏图像或标签一样容易。

any help will be great! 任何帮助都会很棒!

Try: 尝试:

//To hide the tab bar
self.tabBar.hidden = YES;

//To disable tab bar item in tab bar controller
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM