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

Xcode 14 编译的 App 在 iOS 16.0 上可能存在顶部标题布局错乱 #1457

Closed
MoLice opened this issue Nov 1, 2022 · 3 comments
Closed

Comments

@MoLice
Copy link
Collaborator

MoLice commented Nov 1, 2022

Bug 表现

Xcode.14.iOS.16.titleView.bug.mp4

如何重现

  1. vc1 使用系统的标题。
  2. vc2 使用自定义的标题(self.navigationItem.titleView = xxx)。
  3. 通过 animated:NO 的方式,无动画地切到 vc2(不管是通过 pushViewController:animated:NO 还是 setViewControllers:animated:NO),即可看到 vc2 的标题紧贴着导航栏顶部,无法垂直居中。
  4. 无动画地切回 vc1,即可看到 vc1 的标题紧贴着导航栏底部,无法垂直居中。

测试 Demo:TestTitleViewAndSetView.zip

其他测试场景

  1. 如果以动画形式,或者手势返回的形式切换界面,均不会有该问题。
  2. 如果 vc1 是自定义标题,vc2 是系统标题,也不会有问题。
  3. 实际上只要无动画地让标题从系统标题改为自定义标题(例如停留在 vc 里直接 self.navigationItem.titleView = xxx),都会有问题。
  4. 以 Xcode 13 编译的包在 iOS 16 上运行时不会有问题。
  5. 以 Xcode 14 编译的包在 iOS 15 上运行时不会有问题。

其他信息

  • iOS 版本: iOS 16
  • Xcode 版本: Xcode 14
@MoLice
Copy link
Collaborator Author

MoLice commented Nov 1, 2022

但是发现 Xcode 13 编译的包在某些机子上也会,某些机子又不会,不确定这个条件。

@MoLice
Copy link
Collaborator Author

MoLice commented Nov 21, 2022

iOS 16.1 已不存在该 bug

@MoLice MoLice changed the title Xcode 14 编译的 App 在 iOS 16 上可能存在顶部标题布局错乱 Xcode 14 编译的 App 在 iOS 16.0 上可能存在顶部标题布局错乱 Nov 21, 2022
@MoLice
Copy link
Collaborator Author

MoLice commented Dec 7, 2022

已修复该问题,请根据 iOS 版本支持情况选择升级到 4.6.0(iOS 11-16)4.6.1(iOS 13-16)

@MoLice MoLice closed this as completed Dec 7, 2022
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

1 participant