iOS隱藏tabBar的方法


兩種方法用來隱藏tabBar

1.在本頁面隱藏

#pragma mark - 隱藏tabBar

- (void)viewWillAppear:(BOOL)animated{

    self.tabBarController.tabBar.hidden = YES;

}

- (void)viewWillDisappear:(BOOL)animated{

  self.tabBarController.tabBar.hidden = NO;

}

2.再跳界面之前設置跳轉后隱藏tabBar

#pragma mark - 隱藏tabBar

- (void)handleClickTestButtonAction:(UIButton *)sender{

    SecurityTestingViewController *test = [[SecurityTestingViewController alloc]init];

    self.hidesBottomBarWhenPushed = YES;

    [self.navigationController pushViewController:test animated:NO];

}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM