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

iOS14上面popToRoot有问题 #292

Open
huangrun opened this issue Sep 24, 2020 · 5 comments
Open

iOS14上面popToRoot有问题 #292

huangrun opened this issue Sep 24, 2020 · 5 comments

Comments

@huangrun
Copy link

调用popToRootViewControllerAnimated:YES返回到root控制器后,root控制器的导航栏会出现返回按钮(本来是没有的),demo也可复现,希望作者修复!

@yisRookie
Copy link

同求

@huangrun
Copy link
Author

目前我这边发现的解决方案有两个,但不是最优解决方案:
1.关闭动画:popToRootViewControllerAnimated:NO;此方法比较影响用户体验。
2.在导航的root控制器中:

  • (void)viewDidLayoutSubviews {
    self.navigationItem.leftBarButtonItem = nil;
    },注意需要实现返回到该类时该方法要立即被调用。
    还是希望有大神能从这个库里面解决这个问题吧!

@boai
Copy link

boai commented Dec 15, 2020

RTRootNavigationController.m 628行 改为:
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@""

@mlcldh
Copy link

mlcldh commented Dec 15, 2020

iOS 14上,从A push到B,再从B push到C,此时调用[self.navigationController popToRootViewControllerAnimated:YES]就会有这个问题,A左上角会显示“Back”,希望大佬早些修复,谢谢!

执行了下面这个方法:
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", nil)
style:UIBarButtonItemStylePlain
target:self
action:@selector(onBack:)];

@sunsang
Copy link
Contributor

sunsang commented Dec 18, 2020

可以将 willShowViewController 代理方法里的 _installsLeftBarButtonItemIfNeededForViewController 延迟到 didShowViewController 代理方法里执行

image

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

No branches or pull requests

5 participants