【发布时间】:2011-05-04 05:59:59
【问题描述】:
好的,我正在做一个小组项目,我们要做的是创建一个“结果屏幕”,它有它自己的 UINavigation 并在其中包含两个 TabBar。我们正在尝试将其推送到现有 UINavigation 之上。现在在这段代码的那一刻。我们有我们的主 App Delegate,我们在其中实例化了一个开始导航和标签栏。
startTabBarController.viewControllers=[NSArray arrayWithObjects:templatesVC,recentJobsVC,profileVC,aboutVC,nil];
startTabBarController.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"D2P_Logo2.png"]];
startTabBarController.navigationItem.titleView.backgroundColor = [UIColor clearColor];
UIBarButtonItem *tempRightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"New"
style:UIBarButtonItemStylePlain
target:self
action:@selector(makeJob)];
[startTabBarController.navigationItem setRightBarButtonItem:tempRightBarButton];
[mainNavBar pushViewController:startTabBarController animated:NO];
[window addSubview:mainNavBar.view];
现在我们要做的是在顶部添加另一个带有分段导航控制器和标签栏控制器的标签栏。
目前正在尝试使用没有 xib 的 UIViewController 来执行此操作。我尝试了各种方法,但出现的只是一个空白屏幕。
就我们拥有的布局而言,我们有一个导航控制器,它的堆栈上是一个 UITabBarController -> UITableViewController -> UITableViewController,我们希望在其中添加一个带有 UINavigationController 和 UITabBarController 的 UIViewController。
任何建议将不胜感激。提前致谢。
【问题讨论】:
-
欢迎来到 SO - 这似乎是您的第一个问题?只是一个提示 - 编辑器提供“代码”标签以使您的代码更易于阅读。它甚至包括自动语法突出显示。我可以建议您编辑这篇文章并尝试一下吗?
标签: iphone ios uiviewcontroller uinavigationcontroller uitabbarcontroller