2

I have an application where I have hidden the status bar. In the main view I am using UIButtons to load subviews views. For some reason, the subviews appear with hidden status bars, however, the UI View does not adjust for this. There is a status bar sized gap at the top of the view.
I have seen some references to this with regard to earlier version of the IOS where tweaking an auto adjust parameter fixes the issue. Can't seem to locate the same knob in 4.3.
This must be a widely known issue. It's very repeatable. Is there an additional global parameter I should be using in addition to the setStatusBarHidden:withAnimation: class method?

Rich Maes
  • 1,204
  • 1
  • 12
  • 29

2 Answers2

2

In Xcode 4.2.1, we can use the following method after calling setStatusBarHidden:

[viewController.view setFrame: [viewController.view bounds]];

In other words, if you are writing the code for the view controller itself, you can put:

[self.view setFrame: [self.view bounds]];

[Edited] Just found a similar thread: iPhone How to set the top position = 0 after setStatusBarHidden:Yes?

Community
  • 1
  • 1
Wayne Liu
  • 1,172
  • 11
  • 23
0

UIViewController has the property wantsFullScreenLayout, which seems to work fine.

DrMickeyLauer
  • 4,455
  • 3
  • 31
  • 67