首页 > 代码库 > 隐藏UITabBarController中的tabbar

隐藏UITabBarController中的tabbar

在pushViewController之前调用:

1 self.hidesBottomBarWhenPushed = YES;2 ZWMessageViewController *messageController = [[ZWMessageViewController alloc] initWithDict:_dataSource[indexPath.row]];3 [self.navigationController pushViewController:messageController animated:YES];

或者是在 - (void)viewWillAppear:(BOOL)animated 中设置 

self.hidesBottomBarWhenPushed = YES;

同时在viewWillDisappear调用:

1 - (void)viewWillDisappear:(BOOL)animated {2         [super viewDidDisappear:animated];3         self.hidesBottomBarWhenPushed = NO; // 不设置这个,界面跳转回来的时候,tabbar不能成功显示4 }

 

隐藏UITabBarController中的tabbar