重写push方法
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (self.childViewControllers.count > 0) {
// 隐藏tabbar
viewController.hidesBottomBarWhenPushed = YES;
}
[super pushViewController:viewController animated:animated];
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (self.childViewControllers.count > 0) {
// 隐藏tabbar
viewController.hidesBottomBarWhenPushed = YES;
}
[super pushViewController:viewController animated:animated];
//解决iPhoneX push页面时tabbar上移问题
CGRect frame = self.tabBarController.tabBar.frame;frame.origin.y = ScreenHeight - frame.size.height;
self.tabBarController.tabBar.frame = frame;
}