Reputation: 325
I have added a tab bar (UITabBar) in my iPhone application. I want to hide a tab Bar item through code? Is it possible?
Upvotes: 3
Views: 9172
Reputation: 401
Just set alpha for tab you need to hide
UIView *tabItem = self.tabBar.subviews[0];
tabItem.alpha = 0.0;
Upvotes: 0
Reputation: 1
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 )
Upvotes: 0
Reputation: 983
U can Hide BY USING below Code
for(id object in appDelegate.tabBarController.tabBar.subviews)
{
[object setHidden:YES];
}
Upvotes: 2
Reputation: 4254
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;
Upvotes: 1