Reputation: 47328
I have a view laid out in the interface builder. Originally it used a StatusBar added to the top of the view in the interface builder. Now I decided to get rid of the status bar, but when I call
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
My view is still shifted down by 20 points. My guess is that my UINavigationController does not get the message and keeps my view in the old location.
Anyone else has an insight into what might be causing this issue?
I tried:
self.view.center = CGPointMake(self.view.center.x, self.view.center.y-21); This does not work.
I've tried:
self.view.center = CGPointMake(self.view.center.x, self.view.center.y-21);
This works, but leaves a black 20 px bar on the buttom before the tabbar.
How would I transition my view to a status-bar-less mode without having to manualy adjust all the views by 21px?
PS. The view is displayed perfectly if I remove the status bar in the app delegate before creating a UINavigationController for the view
Upvotes: 2
Views: 1382
Reputation: 4164
You might want to call
[myViewController setWantsFullScreenLayout:YES];
That should allow it to take up the spare 20px.
Upvotes: 8
Reputation: 17014
Interface builder has a 'simulate user interface elements' option. Do you still have 'status bar' simulated? You need to deslect that option if your actual view doesn't show a status bar.
Upvotes: 0