我在第四个屏幕上添加标签控制器。直到第 4 个屏幕,当我将选项卡控制器添加到窗口时,我的导航栏现在在第 4 个屏幕上可见,导航栏正在消失......
code written in the tabbedController class is :
- (void)viewDidLoad
{
self.tabController = [[UITabBarController alloc]init];
FirstTabScreen *firstTab = [[FirstTabScreen alloc]initWithNibName:nil bundle:nil];
SecondTabScreen *secondTab = [[SecondTabScreen alloc]initWithNibName:nil bundle:nil];
firstTab.title=@"First";
firstTab.tabBarItem.image = [UIImage imageNamed:@"small_star.png"];
secondTab.title=@"second";
secondTab.tabBarItem.image = [UIImage imageNamed:@"small_star.png"];
tabController.viewControllers = [NSArray arrayWithObjects:
firstTab,
secondTab,
nil];
// self.tabWindow = [[[[UIApplication sharedApplication]keyWindow ]subviews ] lastObject];
//self.tabWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// self.tabWindow = [[UIApplication sharedApplication] keyWindow ];
//self.tabWindow = self.appDelegateAccess.window;
self.tabWindow = self.appDelegateAccess.window;
[self.tabWindow addSubview:tabController.view];
[self.tabWindow makeKeyAndVisible];
// [self.view addSubview:tabsContainer.view];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
请让我知道我哪里出错了....我想我没有引用根窗口来添加选项卡控制器..是这种情况请建议我使用根窗口添加选项卡控制器的方法
谢谢