過去 2 日間からこの問題に直面していますが、解決策を見つけることができました。誰かが助けることができますか。これは、TabBar viewControllers に使用しているコード スニペットです。
// タブバーを設定
NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] initWithCapacity:5];
self.tabBarController = [[UITabBarController alloc] init];
[tabBarController
setDelegate:self];
UINavigationController *navController = nil;
NSArray *vcArray = [self papulateViewControllers];
// タブ バーの SetViewController
-(NSArray *) papulateViewControllers{
BrowseViewController *browseVC = [[BrowseViewController alloc] initWithNibName:@"BrowseViewController" bundle:nil];
AlbumViewController *albumVC = [[AlbumViewController alloc] initWithNibName:@"AlbumViewController" bundle:nil];
SubmitStep1VC *submitVC = [[SubmitStep1VC alloc] initWithNibName:@"SubmitStep1VC" bundle:nil];
// SubmitStep1VC *submitVC = [[SubmitStep1VC alloc] initWithNibName:@"SubmitStep1_iPhone5.xib" bundle:[NSBundle mainBundle]];
WallViewController *wallVC = [[WallViewController alloc] initWithNibName:@"WallViewController" bundle:nil];
OptionVC *optionVC = [[OptionVC alloc] initWithNibName:@"OptionVC" bundle:nil];
sliderVCRef = [[SliderVC alloc] initWithNibName:@"SliderVC" bundle:nil];
//Navigation Controllers
UINavigationController *browseNavController = [[UINavigationController alloc] initWithRootViewController: browseVC];
[browseNavController setNavigationBarHidden:YES];
UINavigationController *albumNavController = [[UINavigationController alloc] initWithRootViewController: albumVC];
[albumNavController setNavigationBarHidden:YES];
UINavigationController *submitNavController = [[UINavigationController alloc] initWithRootViewController: submitVC];
[submitNavController setNavigationBarHidden:YES];
UINavigationController *wallNavController = [[UINavigationController alloc] initWithRootViewController: wallVC];
[wallNavController setNavigationBarHidden:YES];
UINavigationController *optionNavController = [[UINavigationController alloc] initWithRootViewController: optionVC];
[optionNavController setNavigationBarHidden:YES];
DDMenuController *browseMenuController = [[DDMenuController alloc] initWithRootViewController:browseNavController];
self.menuController = browseMenuController;
self.menuController.leftViewController = sliderVCRef;
DDMenuController *albumMenuController = [[DDMenuController alloc] initWithRootViewController:albumNavController];
albumMenuController.leftViewController = sliderVCRef;
DDMenuController *submitMenuController = [[DDMenuController alloc] initWithRootViewController:submitNavController];
submitMenuController.leftViewController = sliderVCRef;
DDMenuController *wallMenuController = [[DDMenuController alloc] initWithRootViewController:wallNavController];
wallMenuController.leftViewController = sliderVCRef;
DDMenuController *optionMenuController = [[DDMenuController alloc] initWithRootViewController:optionNavController];
optionMenuController.leftViewController = sliderVCRef;
/// Works fine if i uncomment this line and comment next line of code (Passing Viewcontrollers is fine )
// return [NSArray arrayWithObjects:self.menuController, albumVC, submitVC, wallVC, optionVC, nil];
////******* issue in case i use this line (Passing menuController creates issue of Tabbar )
return [NSArray arrayWithObjects:self.menuController, albumMenuController, submitMenuController, wallMenuController, optionMenuController, nil];
////////////
}
TabBarController の上から任意の viewcontroler にプッシュしようとすると、タブ バーが非表示になりません。例
grandPrizeVC.hidesBottomBarWhenPushed = YES;
タブバーが表示され続けます。試し
appDelegate.tabbarcontroller.tabbar.hidden = YES;
てみると、新しいVCの黒い下のバーに表示されます。