MoZhouqi / KMNavigationBarTransition

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.
MIT License
3.38k stars 457 forks source link

iOS17导航异常问题 #180

Closed GUIYIVIEW closed 1 year ago

GUIYIVIEW commented 1 year ago

开发环境:Xcode 15 + iOS 17(模拟器+真机14pro)

Demo视图层级结构是 rootViewController = nav + vc,这种层级不会出现问题; 修改为以下

UITabBarController *tab = [UITabBarController new];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[ViewController new]];
tab.viewControllers = @[nav];
self.window.rootViewController = tab;

操作步骤:A(有导航)->B(有导航)->C(无导航)->A,A和C之间如果中间没有B,也不会发生这个问题,怀疑是系统有了修改。 在iOS 17上调用popToRootViewController有动画时,导航会闪一下,如下录屏。视频返回根视图开启了缓慢动画,为了更好的看清过程:

https://github.com/MoZhouqi/KMNavigationBarTransition/assets/9626353/eb90210b-9b76-4cef-93f7-807392119b48

造成异常代码在

UINavigationController+KMNavigationBarTransition.m
- (NSArray<UIViewController *> *)km_popToRootViewControllerAnimated:(BOOL)animated {
    ...
    if (animated) {
       // 问题在这一句,iOS 17之前调用隐藏背景从效果看并未发现隐藏,iOS 17之后明显看到隐藏了背景
        disappearingViewController.navigationController.km_backgroundViewHidden = YES;
    }
    return [self km_popToRootViewControllerAnimated:animated];
}

暂时iOS 17不调用此行代码,等待其他解决方案。 @MoZhouqi

MoZhouqi commented 1 year ago

你好,在最新的 commit 中修复了该问题

GUIYIVIEW commented 1 year ago

你好,在最新的 commit 中修复了该问题

感谢回复,经测试验证无问题,能不能再打个tag

MoZhouqi commented 1 year ago

嗯嗯,1.1.11 版本发布了

MoZhouqi commented 1 year ago

我先把 issue 关了,如果有任何疑问,欢迎再打开