tabBarController 导航问题/疑问

发布于 2024-10-02 08:44:11 字数 520 浏览 1 评论 0原文

我有一个简单的 tabBarController 应用程序,用户可以在其中导航 3 个视图。

在其中一个视图中,我有一个 UIButton,触摸时会将用户移动到第四个视图。问题是新视图没有可见的选项卡栏导航。

我需要对第四个视图做什么才能让它也使用 tabBarController 功能集。

感谢您的帮助,

这里是触摸 UIButton 时转换到第四个视图的代码:

-(IBAction) nextQuestion {

        Question2 *q2 = [[Question2 alloc] initWithNibName:@"Question2" bundle:nil];

        q2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

        [self presentModalViewController:q2 animated:YES];

        [q2 release];

}

I have a simple tabBarController application where the user can navigate around 3 views.

In one of the views I have a UIButton that when touched moves the user to a fourth view. the problem is that the new view doesn't have the tab bar navigation visible.

what do I need to do to the fourth view to have it also use the tabBarController feature set.

thanks for any help

here's the code that transitions to the fourth view when a UIButton is touched:

-(IBAction) nextQuestion {

        Question2 *q2 = [[Question2 alloc] initWithNibName:@"Question2" bundle:nil];

        q2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

        [self presentModalViewController:q2 animated:YES];

        [q2 release];

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两人的回忆 2024-10-09 08:44:11

模态视图控制器总是占据整个屏幕。其目的是提供一个模态界面,在用户关闭模态视图之前,不允许用户与 UI 的其他部分进行交互。

要在选项卡内显示另一个视图,您可以将该选项卡的根控制器设为导航控制器。点击按钮会将问题 2 控制器推送到导航控制器的堆栈上。

A modal view controller always takes up the entire screen. Its purpose is to provide a modal interface that does not let the user interact with other parts of the UI until they dismiss the modal view.

To display another view inside a tab, you could make the root controller of that tab a navigation controller. A button tap would then push the Question 2 controller on the nav controller's stack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文