ios - UINavigationController, how to hide tabbar in second level viewController then show tabbar in third level viewController -
here piece of code, in way, when push third level view controller, tabbar won't show.
//at first level secondlevelviewcontroller *_2vc = [[secondlevelviewcontroller alloc]initwithnibname:@"secondlevelviewcontroller" bundle:nil]; _2vc.hidesbottombarwhenpushed = yes; [self.navigationcontroller pushviewcontroller:_2vc animated:yes]; //at second level thirdlevelviewcontroller *_3vc = [[thirdlevelviewcontroller alloc]initwithnibname:@"thirdlevelviewcontroller" bundle:nil]; _3vc.hidesbottombarwhenpushed = no; [self.navigationcontroller pushviewcontroller:_3vc animated:yes];
instead of setting values of hidesbottombarwhenpushed when initialise view controllers, should instead handle hiding mechanism in -(void)viewwillappear:(bool)animated in view controllers instead.
an example of implementation be:
in secondlevelviewcontroller.m
-(void)viewwillappear:(bool)animated { [_bottombar sethidden:yes]; }
in thirdlevelviewcontroller.m
-(void)viewwillappear:(bool)animated { [_bottombar sethidden:no]; }
Comments
Post a Comment