navigationcontroller 回到上层navigationcontroller

navigationcontroller back to upper navigationcontroller

问题如图所示。我怎样才能从 viewcontroller C 回到 A。 方法 popViewController 动画不起作用。

您的控制器层次结构存在问题。 UIViewController A 和 C 之间不应有 UINavigationController

由于 UITabBarController 推送嵌入在 UINavigationController 中的控制器 A,您的导航已经为此选项卡设置,以后无需重新推送另一个。

因此,要解决您的问题,您应该在第一个选项卡中使用该选项卡:UITabBarViewController -> UINavigationController -> UIViewController A -> UIViewController C。这样,popViewControllerAnimated 将起作用。