Hiding / showing the status bar

I am developing an application for the iPhone that switches from table view to landscape full-screen mode (similar to the YouTube application). When this happens, I want to hide the status bar and then display it again when switching back to the table view. I use setStatusBarHidden, but it looks like it hides the status bar, increasing the screen area; there is still an empty bar where there was a status bar. If the property of the hidden status bar is set in Info.plist, I get an enlarged area of ​​the screen, but when an inscription is displayed in the status bar.

How to hide the status bar so that the whole screen is available for my viewing when it is hidden, and only the screen under the status bar when it is displayed?

TIA.

Craig

PS: I copy / edit this question from the discussion of the application. don't find a good solution http://discussions.apple.com/thread.jspa?threadID=1580662&start=15&tstart=0

+5
source share
2 answers

Your view controller must be set wantsFullScreenLayoutto YES, as well as hiding the status bar: See the UIViewController link .

+11
source

If someone is looking for a solution in which the above solution does not work (and it still has an annoying blue 20px space), try placing it in viewWillAppear in the implementation file of the view controller, which you would like to hide the status bar.

self.navigationController.navigationBar.frame = CGRectOffset(self.navigationController.navigationBar.frame, 0.0, -20.0);

12 , , , , - .

+1

All Articles