0

我有一个基本的疑问。我需要推viewController到另一个viewController。 和我的代码本模型控制器隐藏UITabBar

Display1 *ac =[[Display1 alloc]init];

[[self navigationController]pushViewController:ac animated:YES];

想这给导航以前堆栈的选项。 我不选择对前一个堆栈移动。对于这个原因,我试过presentModalViewController

Display1 *ac =[[Display1 alloc]init];

[self presentModalViewController:ac animated:YES];

但能正常工作这一个不给我选项,但presentModalViewController隐藏我的UITabBarController

。无论如何,用presentModalViewController显示UITabBarController。 或使用pushViewController不显示前一个堆栈

+1

使用此:self.navigationItem.hidesBackButton = YES; – DJB

回答

0

Darshana是正确的,如果你不想回去使用

[[self navigationController]pushViewController:ac animated:YES]; 

但是如果你想UITabBar在新的UIViewController比你有

self.navigationItem.hidesBackButton = YES; 

选项前补充一点,控制器是这样的:

NextViewController *nextViewController=[[NextViewController alloc]initWithNibName:@"NextViewController" bundle:nil]; 
UINavigationController *navBar=[[UINavigationController alloc]initWithRootViewController:nextViewController]; 
[self.navigationController presentModalViewController:navBar animated:YES]; 

我把这个从PresentModalViewController not showing navigation bar on next view

但首先决定你想要使用PUSH OR MODAL。
这两者有不同的目的。