tabBarController 导航问题/疑问
我有一个简单的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模态视图控制器总是占据整个屏幕。其目的是提供一个模态界面,在用户关闭模态视图之前,不允许用户与 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.