#####问题: 在iPhone X 切换Push VC过程中,Tabbar会先上移一下,不知道苹果怎么搞的,iPhone X适配真是坑爹啊,不,是坑儿子。 O(∩_∩)O哈哈~
慢动作图看下效果:

####解决办法:
重写这个- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated方法,重新设置下Tabbar 的frame:
/**
* 重写这个方法,能拦截所有的push操作
*/
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (self.viewControllers.count > 0) {
viewController.hidesBottomBarWhenPushed = YES;
}
[super pushViewController:viewController animated:animated];
// 修改tabBra的frame iPhone X切换切面tabbar上移bug修复
CGRect frame = self.tabBarController.tabBar.frame;
frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
self.tabBarController.tabBar.frame = frame;
}
修复后效果:
