Question

I hope to display the view of one of ViewControllers in my app as full screen , so in Interface Builder, I set the statusbar as None. I also resize the frame of view as 320*480

but when I run the app, the view of the viewcontroller still displays the statusbar.

Welcome any comment

thanks

alt text

Was it helpful?

Solution

Call setStatusBarHidden:withAnimation: on [UIApplication sharedApplication].

OTHER TIPS

it is not diffult to solve the problem. In your project setting plist file, check the key"Status bar is initially hidden", status bar will be removed from startup.

You need to set your view controller's wantsFullScreenLayout to YES. Make your xib file as big as the screen and set this in your viewDidLoad.

wantsFullScreenLayout

A Boolean value indicating whether the view should underlap the status bar.

@property(nonatomic, assign) BOOL wantsFullScreenLayout

Discussion

When a view controller presents its view, it normally shrinks that view so that its frame does not overlap the device’s status bar. Setting this property to YES causes the view controller to size its view so that it fills the entire screen, including the area under the status bar. (Of course, for this to happen, the window hosting the view controller must itself be sized to fill the entire screen, including the area underneath the status bar.) You would typically set this property to YES in cases where you have a translucent status bar and want your view’s content to be visible behind that view.

If this property is YES, the view is not resized in a way that would cause it to underlap a tab bar but is resized to underlap translucent toolbars. Regardless of the value of this property, navigation controllers always allow views to underlap translucent navigation bars.

The default value of this property is NO, which causes the view to be laid out so it does not underlap the status bar.

Availability Available in iOS 3.0 and later.

Declared In

UIViewController.h

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top