项目中有需求是A视图控制器push之后B视图控制器需要隐藏底部的tabbar,在pop之后A视图控制器仍然显示tabbar.
其实不需要在push操作时敲 self.hidesBottomBarWhenPushed = NO;,然后再pop返回时再设置成NO.
对于这个全局属性,可以在A中
- (void)viewWillAppear:(BOOL)animated {
self.hidesBottomBarWhenPushed = YES;
}
- (void)viewDidDisappear:(BOOL)animated {
self.hidesBottomBarWhenPushed = NO;
}