我已经创建了一个 UITabView 应用程序。从栏中选择的每个 View 都是一个单独的 Controller ,具有自己的 nib 文件。我成功地在它们之间切换。
在第一个 View 中,我有两个按钮(查看屏幕截图)。单击它们时,我想切换到另一个 View ,它们是当前 View Controller 的一部分。我使用:
[self presentModalViewController:anotherViewController animated:NO];
这会切换 View ,但会隐藏 UITabBar。切换后如何让bar保持在屏幕上?
附言抱歉图像模糊。我不能分享太多信息。
最佳答案
好吧,我认为你在滥用模态视图 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/