+12  A: 

In the screenshot above, there's a translucent status bar and a translucent navigation bar.

The status bar is set using

[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];

The navigation bar is set using

theNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
August
how to hide the bars on the top and bottom if it is uiwebview in the view controller ??
thndrkiss
This didn't work for me on iPhone Simulator 3.2. From the Xcode Documentation: "Deprecated. Use `UIBarStyleBlack` and set the translucent property to `YES` instead." That worked! :)
MattDiPasquale
When this was written (Dec. 2008), this was the proper way. Of course, over time the API does change. Your method is now correct.
August
A: 

Set the statusbar style as black translucent and navigation bar style as black translucent. If you are using a navigation-based application, in the MainWindow.xib check the status bar is hidden and navigation bar is hidden checkboxes.

When the user touches the screen, start a timer to see if this was a single tap or double tap. If a single tap, make the statusbar and navbar hidden = NO. and once user activity stops, start a timer again. after some time of no activity, make them hidden again.

lostInTransit
A: 

Yes but using setStatusBarStyle:animated: to make it black & translucent doesn't seem to cause your UIView to scroll behind the status bar.

Is there a way to do this? The Photos app does it, but of course it might be using undocumented/private APIs.

+3  A: 

The best way I came up was this: when using a "complex" hierarchy of Tab bar containing navigation controllers, with one "detail" view being a full screen view.

In the app delegate just before the tab bar controller's view is added to the window, I added this:

tabBarController.view.frame = [[UIScreen mainScreen] bounds];

This will make the tab bar controller cover the entire screen, even below the area of the status bar. I had to offset heights of several views to +20px, notably the navigation bars.

Alfons
Given the situation of the O/P I have no doubt that this solution works. However, this solution is not very general. If the tabBarController.view is the subview of a view that is not itself a full screen view this solution will not work. Or the paraphrase, the bounds rect has (0,0) as it's origin, so your tabBarController.view will have it's origin point as the same origin of the super view.
SooDesuNe
+11  A: 

Just set “wants fullscreen layout” in your view controller. That solves the problem for me.

Jonathan Sterling
It seems this is the most simple and effective solution.
St3fan
Set in UIViewController subclass with: self.wantsFullScreenLayout = YES;
petert
+4  A: 

If you have a view controller inside a navigation controller, and you want to hide the status bar in order to have your viewController's view in full screen, you can always call :

[self.navigationController.view setNeedsLayout];

after hiding the status bar. But I personally think

[self setWantsFullScreenLayout:YES];

is a better way.

Unfalkster
A: 

you can have access to lib three20 .you could get some demo code there.

jiansihun