I have added a tab bar (UITabBar) in my iPhone application. I want to hide a tab Bar item through code? Is it possible?
Asked
Active
Viewed 9,136 times
3
-
You don't have to add a dot (.) in front of a question mark (?). ;-) – CodeCaster Nov 16 '11 at 10:49
-
2Check this post http://stackoverflow.com/questions/2116054/particular-tabbar-item-hide-when-app-loads-in-tab-bar-controller – Minakshi Nov 16 '11 at 10:52
5 Answers
2
U can Hide BY USING below Code
for(id object in appDelegate.tabBarController.tabBar.subviews)
{
[object setHidden:YES];
}

Srinivas
- 983
- 9
- 21
1
In the .h file declare a
UIBarButtonItem *mybutton
@property (nonatomic, retain) IBOutlet UIBarButtonItem *mybutton;
attache it to your UiBarButton in IB
then in .m file do
@synthesize mybutton;
mybutton.hidden=YES;

Ajeet Pratap Maurya
- 4,244
- 3
- 28
- 46
0
if you're using storyboard, you can set property of that storyboard "Hide Bottom Bar on Push" on the attributes inspector (the forth small item look like the face of human )
0
Just set alpha for tab you need to hide
UIView *tabItem = self.tabBar.subviews[0];
tabItem.alpha = 0.0;

Artem
- 391
- 3
- 11
0
myObject.hidesBottomBarWhenPushed=YES;

Deepak
- 439
- 1
- 5
- 13
-
1You know that this will hide bottom bar only when a viewcontroller is pushed in it's navigationcontroller stack, right? – Guntis Treulands Oct 22 '13 at 07:44