本文只做记录,就方便寻找
图片出自臭码农
主要解决问题:
解决方法:
重写 UINavigationController 类的 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 方法
具体代码如下:12345678910111213- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ [super pushViewController:viewController animated:animated]; // 修正push控制器tabbar上移问题 if (@available(iOS 11.0, *)){ // 修改tabBra的frame CGRect frame = self.tabBarController.tabBar.frame; frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height; self.tabBarController.tabBar.frame = frame; }}