我正在创建通用应用程序,当我在模拟器(iPhone)中运行应用程序导航栏显示但是当我使用模拟器(iPad)运行它导航栏没有显示。请任何人都可以告诉我为什么会发生这种情况...我对此一无所知.. 这是我的代码。
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
ObjNewFeedVC = [[newFeedsViewController alloc]initWithNibName:@"newFeedsViewController" bundle:nil];
ObjSecondVC = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
}
else{
ObjNewFeedVC = [[newFeedsViewController alloc]initWithNibName:@"newFeedsViewController_iPad" bundle:nil];
ObjSecondVC = [[SecondViewController alloc]initWithNibName:@"SecondViewController_iPad" bundle:nil];
}
objNavController1 = [[UINavigationController alloc]initWithRootViewController:ObjNewFeedVC];
objNavController2 = [[UINavigationController alloc]initWithRootViewController:ObjSecondVC];
tabBarObj = [[UITabBarController alloc]init];
tabBarObj.viewControllers = @[objNavController1,objNavController2];
self.window.backgroundColor = [UIColor whiteColor];
[self.window addSubview:tabBarObj.view];
答案 0 :(得分:0)
模拟器(iPad)不显示导航栏, 在真实设备(iPad)上运行您的应用程序,然后它将显示导航栏...