适配iPhone X Push过程中TabBar位置上移

新手上路,请多包涵

使用tabbarController,push一个新的controller的时候,tabbar会向上移动一段距离

阅读 6.2k
3 个回答

继承uinavigationcontroller重写

  • (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;

    }

参考:
http://www.jianshu.com/p/2aa2...

    • 从哪弄的iPhonex

同遇到,个人认为应该是模拟器bug。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题