1. 程式人生 > >push頁面後隱藏tabbar,pop後顯示tabbar

push頁面後隱藏tabbar,pop後顯示tabbar

1:push頁面後隱藏tabba

在pushViewController之前呼叫 [self setHidesBottomBarWhenPushed:YES];

        [self setHidesBottomBarWhenPushed:YES];
        ARWMyProfileViewController *myProfileVC = [[ARWMyProfileViewController alloc] init];
        myProfileVC.navigationItem.title = @"My Profile";
        [self.navigationController pushViewController:myProfileVC animated:YES];
        

2:pop後顯示tabbar

在viewWillDisappear呼叫:[self setHidesBottomBarWhenPushed:NO]; 

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self setHidesBottomBarWhenPushed:NO];

}