我想尝试将 View Controller 压入堆栈,但我希望它从底部向上动画。我是这样做的:
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:readerViewController];
[[self.navigationController topViewController] presentViewController:navigationController animated:YES completion:nil];
然后我尝试像这样弹出它:
[self.navigationController popViewControllerAnimated:YES];
出于某种原因,pop 什么都不做......
知道如何让它倒退吗?
顺便说一下,我创建一个新的导航 Controller 的原因是,如果我不这样做,导航栏就不会显示,我不确定为什么。
谢谢
最佳答案
您以模态方式呈现 View Controller :这不同于在 View Controller 上推送它。
要使“弹出”(这里的正确术语是关闭)这个模态视图 Controller ,您可以在 self.navigationController
上调用 dismissViewControllerAnimated:completion:
方法。
关于ios - 如何弹出导航 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24668282/