2012-07-22 46 views
0

不工作我已經創建了一個應用程序,它有一個表view.I需要添加標題和that.Here後退按鈕是我在viewcontroller.m文件中的代碼UInavigation控制器,目前modalviewcontroller這的UITableViewController

-(IBAction)go:(id)sender{ 

TableViewController *sec=[[TableViewController alloc]init]; 

sec.modalTransitionStyle=UIModalTransitionStyleCrossDissolve; 
[self presentModalViewController:sec animated:YES]; 

[email protected]"test title"; 

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:sec]; 
[self.navigationController presentModalViewController:navController animated:YES]; 
[navController release]; 
[sec release]; 
} 

我現在需要重新添加按鈕,我的標題欄是不是displayed.Guidance請。

回答

1

您想使用的導航控制器的「推......」方法。在您的應用程序的委託,爲您創造一個UINavigationController,使窗口的根視圖,然後創建一個UIViewController子類,使該UINavigation控制器的根視圖。當這個視圖出現時,它將顯示一個UINavigationBar。

然後創建新的tableview,和你的UIViewController「推」使用

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 

我錯過了一些看法???

+0

我怎樣才能做到這一點.. – Dany 2012-07-22 13:02:59

+0

我曾試圖代碼 的UINavigationController * navigationController?; navigationController = [[UINavigationController的頁頭] INIT]; [self.view addSubview:navigationController.view];並獲得導航欄,但它隨着tableview滾動,它顯示在tableview中,它隱藏內容... – Dany 2012-07-22 13:26:54

相關問題