Why is UINavigationController navbar not at top of the screen?
Hello,
A bit perplexed here, running towards help.
I've got a simple UINavigationController and when loaded, it's about 20 px down from the top of the screen. I don't know why this is the case and I've troubleshooted as best as I could. I have made UINavigationControllers before, and their navbars have all been at the top of the screen. The difference looks to be the same size as the status bar, it's just weird to me.
Please see snippet of the screen shot.
I've got a simple UINavigationController and when loaded, it's about 20 px down from the top of the screen. I don't know why this is the case and I've troubleshooted as best as I could. I have made UINavigationControllers before, and their navbars have all been at the top of the screen. The difference looks to be the same size as the status bar, it's just weird to me.
Please see snippet of the screen shot.
Thank you!
Well, for whatever reason, this behavior was a symptom of not having hooked up my view in interfacebuilder to the window of the app.
I've got a simple UINavigationController and when loaded, it's about 20 px down from the top of the screen. I don't know why this is the case and I've troubleshooted as best as I could. I have made UINavigationControllers before, and their navbars have all been at the top of the screen. The difference looks to be the same size as the status bar, it's just weird to me.
Please see snippet of the screen shot.
Thank you!
I've had the same problem. What I found is that if you have the status bar shown, then hide it, your app's views (including the nav bar, if you have one) stay shifted down as if the status bar is still shown. You need to add a "UIStatusBarHidden" key to your info.plist, with a value of TRUE. That tells the system to launch your app with the status bar hidden.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
I've had the same problem. What I found is that if you have the status bar shown, then hide it, your app's views (including the nav bar, if you have one) stay shifted down as if the status bar is still shown. You need to add a "UIStatusBarHidden" key to your info.plist, with a value of TRUE. That tells the system to launch your app with the status bar hidden.
Interesting. What I've also found is that making sure that in interface builder the size of the view is actually either 480 pixels tall or 460 tall, depending on what you need, is also something to doublecheck.