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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -