ios - 如何将 tabbarcontroller 添加到导航应用程序中

标签 ios xcode4.2

我有一个带有 3 个 View 的导航应用程序,在第二个 View 中,我想添加一个 tarbarcontroller 并控制另外两个 View ,我该怎么做?

最佳答案

假设您有一个 tabBarController ,其中包含两个选项卡:controller1controller1,只要您愿意就可以推送它。

UITabBarController * tabBarController = [[UITabBarController alloc] init];
UIViewController * controller1 = [[UIViewController alloc] init];
UIViewController * controller2 = [[UIViewController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:controller1, controller2 nil];
[controller1 release];
[controller2 release];
[self.navigationController pushViewController:tabBarController animated:YES];
[tabBarController release];

关于ios - 如何将 tabbarcontroller 添加到导航应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8264612/

相关文章:

mysql - iOS 应用程序开发 - 数据库

ios - 如何从表格单元格中删除 UIGestureRecognizer

objective-c - objective-c 中的无名类别和普通类别有什么区别?

ios - swift 4 : FMDBdatabase - Unexpectedly found nil while unwrapping an Optional value

ios - GMSMarker iOS 问题

ios - 为什么 ios/build 文件夹没有包含在 .gitignore 文件中?

ios - 如何更改 WKWebView 中的最小和最大缩放比例?

ios - 使用 map 上的 PINS 时,由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序

ios - ios 开发中基于 XML 的图片库需要帮助

objective-c - printf()、fprintf()、wprintf() 和 NSlog() 不会在 XCode 上打印