rickytan / RTRootNavigationController

Implicitly make every view controller has its own navigation bar
MIT License
2.15k stars 378 forks source link

iOS14上面popToRoot有问题 #292

Open huangrun opened 4 years ago

huangrun commented 4 years ago

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

yisRookie commented 4 years ago

同求

huangrun commented 4 years ago

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

boai commented 3 years ago

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

mlcldh commented 3 years ago

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 commented 3 years ago

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

image