【问题标题】:Does the method popViewControllerAnimated: act different than the Back button of the NavigationController?popViewController Animated: 方法是否与 UINavigationController 的后退按钮不同?
【发布时间】:2014-01-13 13:56:55
【问题描述】:

在我的应用程序中,我有一个容器 ViewController,它是 UINavigationControllerRootView

我通过ToolbarToolbar 中的segmentedControl 在各种Child ViewControllers 之间转换。

其中一个Child views 将另一个View 推到NavigationController 上,同时保持ToolbarItems

使用后退按钮,我得到了返回RootViewController 的期望行为,但任何以编程方式返回的尝试都不会改变viewpopViewControllerAnimated 总是采用堆栈的topViewController,但不会更新视图。 Container ViewController 中的 viewWillAppear 不会以这种方式调用。 所以我想知道“后退”按钮是否会执行popViewControllerAnimated 不会发生的任何其他事情。 同样popViewControllerAnimated:YES 将冻结应用程序而不会引发错误。

提前感谢您的帮助。

编辑: 好的,一个测试用例有点。

堆栈的 topViewController 中的 popViewControllerAnimated 正常工作。但是通过 SegmentedControll 调用 popViewControllerAnimated 则不会。

我意识到我写这篇文章的方式可能有点混乱,稍后我会尽量让这一切变得更清楚。

【问题讨论】:

    标签: ios uinavigationcontroller popviewcontroller popviewcontrolleranimated


    【解决方案1】:

    好的,这是时间问题。我在调用popViewControllerAnimated之后直接更改了容器ViewController的ChildViews。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 2011-01-15
      相关资源
      最近更新 更多