2009-10-03 82 views
0

我不使用IB多創建我的意見,所以我通常以編程方式做所有事情。我bascially推視圖控制器到導航控制器,它似乎是viewController的頂部是在導航欄下。我正在嘗試使視圖正確合適。iPhone開發:視圖不適合我的UINavigation控制器

這裏是我的代碼:

navigationController = [[UINavigationController alloc] initWithNibName:nil 
                   bundle:nil]; 
[window addSubview:navigationController.view]; 

viewController = [[UIViewController alloc] init]; 

//this code was just added to try and make it fit. It doesn't change anything 
viewController.view.frame = [UIScreen mainScreen].applicationFrame; 

[navigationController pushViewController:viewController animated:NO]; 

回答

0

我會用init方法與視圖控制器要小心 - 而不是看initWithNibName:bundle:

+0

更改它並沒有解決它。我以前從來沒有遇到過導航控制器的問題。 – TheGambler 2009-10-03 13:15:47

+0

已將其更改爲initWithNibName:nil bundle:nil – TheGambler 2009-10-03 13:16:46

+0

仍然不起作用 – TheGambler 2009-10-03 14:57:28

相關問題