最近在實(shí)現(xiàn)iPhone X的適配過(guò)程中偶遇了一個(gè)問(wèn)題,push的過(guò)程中tabbar的位置會(huì)往上移動(dòng)

QQ20171018-112736-HD.gif
解決方法:
創(chuàng)建一BaseNavigationController繼承于UINavigationController,重寫(xiě)pushViewController代理方法:
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
[super pushViewController:viewController animated:animated];
//改tabBar的frame
CGRect frame = self.tabBarController.tabBar.frame;
frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
self.tabBarController.tabBar.frame = frame;
}