Iphone UItableviewcontroller中不工作的当前modalviewcontroller的导航控制器
我已经创建了一个具有表视图的应用程序。我需要为此添加标题和后退按钮。这是我在viewcontroller.m文件中的代码Iphone UItableviewcontroller中不工作的当前modalviewcontroller的导航控制器,iphone,ios,xcode,uitableview,uinavigationcontroller,Iphone,Ios,Xcode,Uitableview,Uinavigationcontroller,我已经创建了一个具有表视图的应用程序。我需要为此添加标题和后退按钮。这是我在viewcontroller.m文件中的代码 -(IBAction)go:(id)sender{ TableViewController *sec=[[TableViewController alloc]init]; sec.modalTransitionStyle=UIModalTransitionStyleCrossDissolve; [self presentModalViewController:sec an
-(IBAction)go:(id)sender{
TableViewController *sec=[[TableViewController alloc]init];
sec.modalTransitionStyle=UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:sec animated:YES];
self.title=@"test title";
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:sec];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
[sec release];
}
我现在需要添加后退按钮,但我的标题栏不显示。请提供指导。您想使用导航控制器的“按下…”方法。在应用程序委托中,创建UINavigationController,使其成为窗口的根视图,然后创建UIViewController子类,并使其成为UINavigation控制器的根视图。当此视图出现时,将显示一个UINavigationBar 然后创建这个新的tableview,UIViewController使用
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
我错过了什么吗?我试过代码UINavigationController*navigationController;导航控制器=[[UINavigationController alloc]init];[self.view addSubview:navigationController.view];还有导航栏,但它和tableview一起滚动,显示在tableview的中间,隐藏了内容。。。