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
What are you using as the frame when creating the view? I just posted something related, using the applicationFrame property in UIScreen introduced the gap for me, using bounds instead worked.
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...
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.
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.
Perhaps Apple thinks that if you are using a navigation bar, you should not be hiding the status bar? What reason do you have for wanting the navigation bar without the status bar? Fully custom interfaces clearly don't need the status bar, but for UIKit apps I don't see a reason to hide it.
My application doesn't hide the status bar. It's just embedding the navigation controller inside another view controller (in this case, the RootViewController from the Utility Application template).
It occurs to me that under some circumstances, the origin for drawing controls is reset to the parent control's upper left corner. If that parent is already a view which takes the status bar into account, then that might explain the extra space. Could that be the case here?
Something like that - I'm sure it has to do with how IB sets things up. This was a problem for me with certain types of nested views - I changed the way I structure my views in IB and all is well. Since I'm not 100% sure of the cause I was hoping someone that has an example of this problem could post their controller and view hierarchy.