iphone - 在 UITabBar View 中切换 View

标签 iphone objective-c cocoa-touch uikit uitabbar

我已经创建了一个 UITabView 应用程序。从栏中选择的每个 View 都是一个单独的 Controller ,具有自己的 nib 文件。我成功地在它们之间切换。

在第一个 View 中,我有两个按钮(查看屏幕截图)。单击它们时,我想切换到另一个 View ,它们是当前 View Controller 的一部分。我使用:

[self presentModalViewController:anotherViewController animated:NO];

这会切换 View ,但会隐藏 UITabBar。切换后如何让bar保持在屏幕上?

alt main alt after_click

附言抱歉图像模糊。我不能分享太多信息。

最佳答案

好吧,我认为你在滥用模态视图 Controller 。对于这样的问题,我会说你应该使用 UINavigationController 将它们放在 View Controller 堆栈中。与其将每个选项卡都设为 UIViewController,不如将其设为 UINavigationController,然后您可以在其上推送和弹出 View Controller ,它仍然显示选项卡栏。
参见 http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html

关于iphone - 在 UITabBar View 中切换 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2127882/

相关文章:

iphone - 通过 segue 从 UITableViewCell 填充 DetailController

iphone - 根据用户的输入选择警报消息

ios - 如何在共享扩展 View Controller 中获取标题?

iphone - 核心数据管理对象上下文保存问题

cocoa-touch - UITableViewCell 子类,在代码中绘制,动画中的删除按钮

ios - 获取UITableView的最小高度

iphone - 是否有一种编程方式来访问 iTunes Connect 销售报告?

iphone - 无法发推文图片

objective-c - JTRevealSideBar splitview添加UISwipeGesture

iphone - PerformSelectorInBackgroundThread 和 NSTimer