在我的应用程序中,我当前正在调用navigationController.popToRootController(),然后立即将一些控制器推送到堆栈上,但它导致了一个奇怪的UI错误。新的控制器不是从左边出现,而是从下往上出现,奇怪的是屏幕顶部的导航栏完全消失了。无法向后导航,无法与任何导航项目交互...就这么走了。想知道这是否与弹出到根控制器有关,然后立即尝试推送新的控制器,这可能会导致这个奇怪的bug。希望有人能对此有所了解。谢谢!
fileList是一个导航控制器
fileList.popToRootController()
fileList.clearList()
var isRoot = true
for file in (deepLinkFolder?.fileList)! {
// push file controller onto navigation controller (fileList)
}
发布于 2018-06-07 05:53:56
如果您想像这样改变弹出后的推送,最好像这样重置viewControllers
属性,这可能是因为弹出和推送的动画都设置为true,所以会发生干扰
self.navigationController?.viewControllers = []
或使用动画
self.navigationController?.setViewControllers([],animated:true)
https://stackoverflow.com/questions/50730047
复制相似问题