Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Space above Navigation Controller Navigation Bar

So I am using a Navigation controller in a sub view of my main view. When the view for that navigation controller draws it draws as if it had a 20 pixel pad for the status bar. But there is no notion of a status bar in the middle of my application. The only way, I have found, to work around this is to fake it by moving the UIView that is hosting the navigation control up 20 pixels and setting it to [UIColor clearColor.]

As my app becomes more complex managing this magic 20 pixels is becoming difficult, anyone have a notion on how to make the navigation control not pad for the status bar?

iphone, Mac OS X (10.5.3), iphone UINavigationController

Posted on Jun 6, 2008 12:34 PM

Reply
13 replies

Jun 9, 2008 2:54 AM in response to Geoffrey Peart

I'm having the same problem. I ran the example and somehow this line:

CGRect appFrame = [[UIScreen mainScreen] applicationFrame];

gave me:
appFrame.origin.x = 0
appFrame.origin.y = 0

on the console. While my app gave me that 20 pixel gap with:
appFrame.origin.x = 0
appFrame.origin.y = 20

-----
I modified the plist to hide status bar, that 20 pixel gap is now gone.

Message was edited by: SystemR

Jun 9, 2008 8:00 AM in response to SystemR

The problem is that the Application frame isn't the frame that I am using.

Imagine a larger application, nested inside that application is a way to expose a view that only takes up a portion of the screen, not all of it. So that view has its own vertical upper limit that is already below the system status bar (which I actually want.) Within that view I have a Navigation Controller that navigation controller is bound to the top of that view. The navigation controller is creating a 20 pixel space, then the nav bar, and then the content view. Artificially lowering the top of the view by 20 pixels.

I can work around this though a lot of crazy coordinate manipulation, but it would be simpler if I could just tell the navigation controller to not automatically adjust. Frustrating...

Aug 4, 2008 9:15 AM in response to Geoffrey Peart

I too am experiencing this problem.. just created a simple project using the utility application template. If I hide the status bar, (using Info.plist UIStatusBarHidden) and hide the bars in IB, the status bar does not appear, but the 20 pixels at the top of the screen is unresponsive to touch, so for example, only the bottom half of the Done button on the flipside gets touched.

Is there some other rect I should be adjusting?

thanks
michael

Aug 16, 2008 11:52 PM in response to lsal

has anyone found an answer?
I have been looking at this issue all day long... whew!

this white spaced gap only occurs within my IB created TabBarController ViewControllers. When I am outside of the TabBarController, everything works fine and the "gap" is gone. I tried to get rid of the IB approach and write code... but got the same issues. To explain it visually... I have the
Navigation Bar
the "gap"
ViewController (called within IB TabBarController)
the tabbar.

Any direction would be appreciated.

Space above Navigation Controller Navigation Bar

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.