3

I have added a tab bar (UITabBar) in my iPhone application. I want to hide a tab Bar item through code? Is it possible?

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
Rao Rules
  • 325
  • 1
  • 7
  • 19

5 Answers5

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