Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone X 下,UITabBarController 在切换界面时 tabBar 往上跳动 #217

Closed
4 tasks done
MoLice opened this issue Sep 28, 2017 · 5 comments
Closed
4 tasks done

Comments

@MoLice
Copy link
Collaborator

MoLice commented Sep 28, 2017

请填写运行环境

  • 设备:iPhone X 模拟器
  • 系统:iOS 11.0
  • Xcode 版本:9.0
  • QMUI iOS 版本:2.0.0

请描述具体问题

截图如下:
image

image

重现条件:

  1. UITabBarController 内包 UINavigationController,UINavigationController 内包界面 A 和界面 B。
  2. 界面 A.hidesBottomBarWhenPushed = NO,界面 B.hidesBottomBarWhenPushed = YES。
  3. 从界面 A push 到界面 B,可观察到 tabBar 瞬间往上跳动。

属于 UIKit 自身的 bug。

@MoLice
Copy link
Collaborator Author

MoLice commented Oct 18, 2017

tabBar 视觉上的跳动可以解决,但因为 safeAreaInset.bottom 错误地变成 0,导致 scrollView 的 contentOffset 会跟着变,这个暂时不好解决。

@Archer353
Copy link

您好,视觉上的跳动是怎么解决的?

@sea-caterpillar
Copy link

sea-caterpillar commented Nov 16, 2017

@Archer353 我是在继承QMUINavigationController的NavigationController里重写pushViewController:(UIViewController *)viewController然后修改tabBar的frame ;

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ [super pushViewController:viewController animated:animated]; CGRect frame = self.tabBarController.tabBar.frame; frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height; self.tabBarController.tabBar.frame = frame; }

@MoLice
Copy link
Collaborator Author

MoLice commented Dec 4, 2017

该 bug 在 iOS 11.2 里已被系统修复,QMUI 仅对 iOS 11.2 以前的版本做修复兼容,在即将发布的新版本里会带上。

@MoLice
Copy link
Collaborator Author

MoLice commented Dec 5, 2017

请查看配置表开关 shouldFixTabBarTransitionBugInIPhoneX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants