1
votes

My iPhone app display Tab-bar with 3 tabs on button Click. It works fine with initial 3 UIViewControllers. But when I try to push new UIViewController within any TAB, tab bar disappears. I even tried other solution mention here http://stackoverflow.com/questions/31087181/tab-bar-controller-is-not-in-all-uiviewcontrollers However I could only see blank space with no tab bar options...

enter image description here

I tried without navigation pushing UIViewController like normal way. I also pushing UIViewController from Tab bar (having navigation controller for UIViewController) but any of ways not giving me desired result. I do not want two navigation item or pushing new view without tab bar.

All UIViewController's should display within one navigation and Tab bar.

Please help

NOTE: i load TABBar from click of button on home uiviewcontroller like

like

    -(IBAction)btnReceivePressed:(id)sender
 {
     TabBarViewController *about_vc = (TabBarViewController*)[[UIStoryboard   storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"TABBAR"];
     [[self navigationController] pushViewController:about_vc animated:YES];
 }

below are the screen shot which shows two navigation item .. enter image description here]3 [enter image description here][4 enter image description here

1
If you push, the tabbar should persist unless you checked the hides bottom bar on push option for themTj3n

1 Answers

2
votes

Try this to set property of UIViewcontroller:

enter image description here

Another solution for Two Navigation Bar :

You need to change in AppDelgate as below :

From :

 UINavigationController *naController =[[UINavigationController alloc ]initWithRootViewController:self.tabBarController];
  naController.navigationBarHidden = NO;
  self.window.rootViewController = naController;

With :

self.window.rootViewController = self.tabBarController;

Third Solution If you are using push .

- (IBAction)btnReceivePressed:(id)sender {
    TabBarViewController about_vc = (TabBarViewController)
    [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"TABBAR"]; 
    [self navigationController].navigationBarHidden = YES;
    [[self navigationController] pushViewController:about_vc animated:YES];
 }