When using hidesBottomBarWhenPushed, i want the tab bar to reappear when i push another view

前端 未结 6 1196
南方客
南方客 2020-12-06 11:09

I have a navigation controller. For one of the views i want to hide the bottom tab bar, so it gets the max possible screen real estate. To do this, i have:

-         


        
6条回答
  •  感情败类
    2020-12-06 11:53

    In a root view controller "A" (which is showing the tabBar), when it comes time to show another view controller "B" where no tabBar is wanted:

    self.hidesBottomBarWhenPushed = YES; // hide the tabBar when pushing B
    [self.navigationController pushViewController:viewController_B animated:YES];
    self.hidesBottomBarWhenPushed = NO; // for when coming Back to A
    

    In view controller B, when it comes time to show a third view controller C (tabBar wanted again):

    self.hidesBottomBarWhenPushed = NO; // show the tabbar when pushing C
    [self.navigationController pushViewController:viewController_C animated:YES];
    self.hidesBottomBarWhenPushed = YES; // for when coming Back to B
    

提交回复
热议问题