2

I'm having problem in Tabbar-Navigation based application. I have a tab bar with 3 tab bar button items.

Each Tab bar item, I need to show the Navigation controller's view. When I click on the first button, I need to show Navigation controller's root view.

I need that when navigation controller's view is pushed, then in one view I need to show tab bar. When second view is pushed, I need to hide tab bar. When third view is pushed, I need to show tab bar again. It should also work when the view is popped up.

In Navigation controller's root view (Main view), I need to show the tab bar at bottom. But a new view (first view) is pushed then I need to hide the tab bar. Then I have set the property hidesBottomBarWhenPushed to YES.

FirstViewController *firstController = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
firstController. hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:firstController animated:YES];

It works fine with the first view.

But the problem is when I push a new view (Second view) , tab bar is not shown even if I set the property:

SecondViewController *secondController = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
secondController. hidesBottomBarWhenPushed = NO;
[self.navigationController secondController animated:YES];
NSS
  • 721
  • 1
  • 10
  • 23
  • Is this correct ? `[self.navigationController pushViewController:selImageList animated:YES];` Shouldn't it be `firstController ` instead of `selImageList` ? – Illep Jan 06 '12 at 14:42
  • See my answer here: http://stackoverflow.com/a/23269013/318834 – Loz Mar 18 '15 at 14:32

1 Answers1

1

Let me know if this works.

FirstViewController *firstController = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
//firstController. hidesBottomBarWhenPushed = YES;
[self.navigationController presentViewController:firstController animated:YES];
Illep
  • 16,375
  • 46
  • 171
  • 302
  • NO it's not working bcoz tab bar is shown when first view is displayed. And I need to hide the Tabbar for the first view. – NSS Jan 07 '12 at 09:01