When you find the app jumping from the home controller to the next N-level controller one day, you need to hide the bottom tabar.
Looking for a half-day data, found that the controller has a property called hidesbottombarwhenpushed, but do not know how
First, add a classification method to the controller Uiviewcontroller:
-(void) Pushviewcontroller: (nonnull uiviewcontroller *) Viewcontroller {
viewcontroller.hidesbottombarwhenpushed = YES;
[Self.navigationcontroller Pushviewcontroller:viewcontroller Animated:yes];
}
When you want to jump to call this method has no effect, after I changed to the following:
-(void) Pushviewcontroller: (nonnull uiviewcontroller *) Viewcontroller {
self.hidesbottombarwhenpushed = YES;
[Self.navigationcontroller Pushviewcontroller:viewcontroller Animated:yes];
self.hidesbottombarwhenpushed = NO;
viewcontroller.hidesbottombarwhenpushed = YES;
}
Perfect solution, then changed the way: Custom a xquinavigationcontroller inherit from Uinavigaitoncontroller, in the inside rewrite the following method:
-(void) Pushviewcontroller: (Uiviewcontroller *) Viewcontroller animated: (BOOL) animatetd
{
if (Self.childViewControllers.count > 0)//non-root controller
{
viewcontroller.hidesbottombarwhenpushed = YES;
}
[Super Pushviewcontroller:viewcontroller animated:animated];
}
Then the Tabbarcontroller root controller is also perfectly solved using Xquinavigationcontroller.
iOS Home controller jump Hide Tabbar on bottom of app