2013-03-22 81 views
2

我在我的應用程序中使用了一個UINavigationController,它工作得相當好。在我的集合視圖中顯示標題時,導航欄似乎已經設置在堆棧中的較高位置,允許在其下面呈現內容。從覆蓋內容中停止UINavigationBar

有誰知道我可能會在導航欄下面顯示標題,而不是在它下面?

任何幫助非常感謝!

編輯

如果有幫助,我跑以下命令:

NSLog(@"Navigation Bar Bounds %@", NSStringFromCGRect(self.navigationController.navigationBar.bounds)); 
NSLog(@"Navigation Bar Frame %@", NSStringFromCGRect(self.navigationController.navigationBar.frame)); 
NSLog(@"Collection View Bounds %@", NSStringFromCGRect(self.collectionView.bounds)); 
NSLog(@"Collection View Frame %@", NSStringFromCGRect(self.collectionView.frame)); 

隨着輸出如下:編輯

[4058:907] Navigation Bar Bounds {{0, 0}, {320, 44}} 
[4058:907] Navigation Bar Frame {{0, 20}, {320, 44}} 
[4058:907] Collection View Bounds {{0, 0}, {320, 504}} 
[4058:907] Collection View Frame {{0, -22}, {320, 504}} 

我已經上傳下面的圖像來演示該問題:

故事板內部:

Inside My Storyboard

當應用程序加載,什麼導航欄被隱藏:

When the application opens What the Navigation bar is hiding

完整的故事板,顯示導航控制器和根視圖控制器。 UICollectionView是HomeViewController.h文件中的IBOutlet。

The Full Storyboard

+0

這是一個滾動視圖?那麼用戶可以向下滾動顯示標題? – Jordan 2013-03-22 02:06:36

+0

據我所知,它只是一個帶有UICollectionView的普通視圖控制器。 – Asciant 2013-03-22 02:17:51

+0

什麼是rootViewController?UIViewController或UICollectionViewController? – 2013-03-22 02:36:42

回答

1

我認爲你需要改變你的ViewController爲 「導航欄」 的 「TOB欄」,並把你的控件上

檢查這一形象

enter image description here

+0

謝謝Mahmoud,這解決了我的問題!乾杯 – Asciant 2013-04-01 05:58:43