gpt4 book ai didi

UINavigationController 的 setViewControllers 在 IOS10 中添加后退按钮

转载 作者:行者123 更新时间:2023-12-03 14:58:28 26 4
gpt4 key购买 nike

注意到奇怪的事情:当您使用 setViewControllers:animated 替换 UINavigationController 中的 View Controller 堆栈时:动画过程中显示后退按钮,动画完成时后退按钮消失。仅在 iOS10(设备和模拟器)中发现,iOS8 和 9 正常工作(没有后退按钮)。有没有人遇到过这个问题?

最佳答案

同样的问题,但即使是动画:假。
我还意识到,当我不断重复时,内存会增加。他们留在后台吗?

我的代码:

firstNavigationViewController.setViewControllers([firstRootViewController, secondViewController], animated: false)//
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController = firstNavigationViewController

我的解决方法是在 viewWillAppear 中设置以下内容:
navigationController?.navigationBar.backItem?.title = "Protokoll"

关于UINavigationController 的 setViewControllers 在 IOS10 中添加后退按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45536848/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com