0

我的應用程序在4英寸屏幕(= iPhone 5)的頂部顯示一個白色條。對於iPhone 4,它很好地工作(沒有顯示白條)。什麼問題(iOS SDK 6.1)?iPhone 5在模擬器中的白色條紋

這是,如何添加的UINavigationController:

self.navigationController = [[UINavigationController的頁頭] initWithRootViewController:exploreViewController];

self.navigationController.navigationBar.tintColor = [UIColor greenColor]; 
self.navigationController.navigationItem.hidesBackButton = YES; 

[self.view addSubview:self.navigationController.view]; 

最佳, 斯特凡enter image description here

enter image description here

+1

你使用筆尖還是故事板? – Polyov

+0

我正在使用一個筆尖並以編程方式添加一個UINavigationController。我使用UINavigationController來顯示不同的中心視圖(粉紅色)和UINavigationBar(綠色)。 – Stefan

+1

確保您設置的筆尖適合兩種尺寸的設備。請參閱:http://stackoverflow.com/questions/13275144/how-to-make-xib-compatible-with-both-iphone-5-and-iphone-4-devices – Polyov

回答

2

變化

[self.view addSubview:self.navigationController.view];

[self.window setRootViewController:self.navigationController];

您應該在您的AppDelegate中添加導航控制器。 Here's a good tutorial