2013-03-22 83 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