Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab bar appearing after popping a view controller

I'm developing an iOS application, and in that app, I'm using a tab bar controller. And from within tab bar controller is navigating to another view controller. Before pushing the view controller I'm setting a property of that controller

viewController.hidesBottomBarWhenPushed = YES;

And I'm navigating to another view controller which has the tab bar at the bottom.

The problem is when I pop the view controller back to the view controller the tab bar appears in that view too. Is there a way to hide the tab bar when popping a view controller?

It'll be great if anyone can help me out with this.

Thanks in advance.

like image 683
era Avatar asked Apr 05 '13 07:04

era


1 Answers

In that case viewWillAppear method will usefull. in your firstviewcontroller put this code

-(void)viewWillAppear:(BOOL)animated
{
   self.tabBarController.tabBar.hidden = YES;
}

So when secondviewcontroller poped out then it will call this method and your bottom bar will be hidden .

like image 145
Dilip Avatar answered Oct 19 '22 20:10

Dilip