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
Call setStatusBarHidden:withAnimation: on [UIApplication sharedApplication].
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
Related
There is a black strip, of the same frame as the status bar on the top of the screen despite setting the status bar hidden, using :
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
The StatusBarhides without any hiccups. But the black strip is persistent. It is causing my view to be resized, which is supposed to be fullscreen.
I have tried setting wantsFullScreenLayout to YES, in vain.
Is there a way to hide it, or set it's alpha ?
I do NOT use any XIBs. I do everything programmatically only, so I cannot change any properties in the XIB.
To go in a bit of detail, I have a UINavigationController with a rootViewcontroller. The user taps an image, and I push MWPhotoBrowser on it, which can further push other viewControllers like this:
rootViewController -> photoBrowser -> otherViewControllers -> ...
-> = PUSH operation
If any other details are needed, please tell me.
Thank you.
No. No need to set any alpha value.
Just go through your xib.
Select the view of your view controller
Go to Attribute Inspector
Check the value for status bar, navigation controller & bottom bar over there
Set status bar to None if not.
Change topbar & bottombar as per your requirements
Adjust your gui accordingly.
Turns out a view in the view hierarchy was not resized appropriately.
In the storyboard or xib file set Status bar at "none" in Attributes inspector > simulated section
I've got this simple problem that is really making me crazy.
I've got a navigation controller, the root view controller is a VC that has a view that should be presented without displaying the navigation bar. To achieve that I've set the navigationBarHidden property of the navigationController bar to YES in the -viewWillAppear: method, inside the rootVC.
To display it again I've set in the -viewWillDisappear: method of the rootVC the same property to NO.
If I ask the view its frame.size it will answer correctly 320 width and 460 height.
When I push another view (I can see navbar appear) if I ask the view for its size it says me that is 320x460 and this wrong it should tell me something like 320x416.
If I push another view and ask for its size now I get the correct size 320x416. If now I pop pressing back I get again the correct size.
The fact is that the "middle" view is overlapped for 44 points by the navigation bar and I'm not able to make it the correct size except for hardcoding its size and I don't want.
The view autoresizing mask is blocked by IB because is the one of the file's owner. The status bar style is blck opaque.
Do you have some hints for me?
THX,
Andrea
Try setting the property to YES in the second view instead of the first view.
I have the tab bar based application and each tab is a navigation based viewcontroller sometimes when my application entered in to background, and it comes back to foreground i am missing the navigation bar in the viewcontroller.
Why it happening like this?
Check that the UINavigationController's navigationBarHidden property is set to NO. If it is check the frame of the UINavigationBar (and all other relevant UIView properties like hidden, alpha etc).
I've added a tab bar controller to my app delegate. In IB, I adjusted the alpha property and unchecked opaque, however in the simulator I get transparency over a white background, even though there should be content below it.
Perhaps, the containing View needs to be resized to the full dimensions of the screen? I'm using a nav controller with a tableview in this tab bar item.
What? You want your UITabBar to be translucent? A UITabBar is not a subclass of UINavigationBar, therefore the content from any view controllers the tab controller manages will not appear under the tab bar, if that's what you're trying to do.
I have an iPhone Application, that uses a Navigation controller and TabBar controller.
In a first view, I show an a tableview, and when I click on first tableview cell, I set a new view with new Toolbar and without TabBar.
The new view correctly shows the toolbar, but this is far from 40px down, as if it were always leaving the seat to the previous TabBar.
In that regard, I saw that Interface Builder sets the size of the view in 320 x 460, and not with the classic 320 x 480. Unfortunately they are not editable fields (they are grayed out as if it were a lock). Why?
Images:
iPhone APP
http://img89.imageshack.us/img89/5717/schermata20110531a00243.jpg
Interface Builder Options
http://img716.imageshack.us/img716/2817/schermata20110531a00250.png
Thanks,
Alessandro from Italy
Set hidesBottomBarWhenPushed to TRUE before you push the view controller.
The 20px difference is the height of status bar. You can set if the view been shown with or without a status bar from the view's property pane of IB.
If you are using interface builder, try placing the toolbar at the bottom of the view and adjust the stud to keep it at the bottom(turn on the bottom stud on), this will help surely.