gpt4 book ai didi

ios - 从 UITabbarController 推送导航到 UIViewController

转载 作者:行者123 更新时间:2023-11-28 22:23:57 24 4
gpt4 key购买 nike

我正在使用 UITabbarController,它有三个名为 FirstViewControllerSecondViewControllerThirdViewController 的子 UIViewController 。我在 FirstViewController 上有一个按钮。当我们点击按钮时,它需要推送导航到 FourthViewController。这里 FourthViewController 在 UITabBarController 内部导航。但我需要它导航出 UITabBarController 而不是内部。

按钮目标 Action

ForthViewController *share = [[ForthViewController alloc] init];
[self.navigationController pushViewController:share animated:YES];

谁能指导我正确的方法。提前致谢..

最佳答案

试试这个:

ForthViewController *share = [[ForthViewController alloc] init];
[self.parentViewController.navigationController pushViewController:share animated:YES];

只要您的标签栏 Controller 在导航 Controller 中,这就会将您的 View Controller 推送到该导航堆栈上。

关于ios - 从 UITabbarController 推送导航到 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19521207/

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