ios - UINavigationController.navigationBar setHidden:NO doesn't work? -
i have homeviewcontroller
, has property searchviewcontroller
.
homeviewcontroller
delegate of searchviewcontrollerdelegate
can pop searchviewcontroller
when click button in searchviewcontroller.view
(i use pushviewcontrolleranimated:
push searchviewcontroller
view controller stack.
i want show navigationbar
when searchviewcontroller
popped up.
however
[self.navigationcontroller.navigationbar sethidden:no];
is not working.
i've checked navigationbar not nil
can't figure out problem might be.
actual code
#pragma mark - hometabsearchtableviewdelegate -(void)parentviewcontrollerpop{ [self.navigationcontroller popviewcontrolleranimated:yes]; [self.navigationcontroller.navigationbar sethidden:no]; }
searchviewcontroller
popped successfully, navigationbar problem.
on homeviewcontroller
-(void)viewwillappear:(bool)animated{ [super viewwillappear:animated]; [self.navigationcontroller setnavigationbarhidden:no]; //shows //or use // [[self navigationcontroller] setnavigationbarhidden:no animated:yes]; } -(void)viewwilldisappear:(bool)animated{ [super viewwilldisappear:animated]; [self.navigationcontroller setnavigationbarhidden:yes]; // hides //or use // [[self navigationcontroller] setnavigationbarhidden:yes animated:yes]; }
Comments
Post a Comment