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
Related
I have a view laid out in the interface builder. Originally it used a StatusBar added to the top of the view in the interface builder. Now I decided to get rid of the status bar, but when I call
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
My view is still shifted down by 20 points. My guess is that my UINavigationController does not get the message and keeps my view in the old location.
Anyone else has an insight into what might be causing this issue?
I tried:
self.view.center = CGPointMake(self.view.center.x, self.view.center.y-21); This does not work.
I've tried:
self.view.center = CGPointMake(self.view.center.x, self.view.center.y-21);
This works, but leaves a black 20 px bar on the buttom before the tabbar.
How would I transition my view to a status-bar-less mode without having to manualy adjust all the views by 21px?
PS. The view is displayed perfectly if I remove the status bar in the app delegate before creating a UINavigationController for the view
You might want to call
[myViewController setWantsFullScreenLayout:YES];
That should allow it to take up the spare 20px.
Interface builder has a 'simulate user interface elements' option. Do you still have 'status bar' simulated? You need to deslect that option if your actual view doesn't show a status bar.
When I push a view via my app's navigationController, it automatically puts a back button on the left side of the navigationBar. Is there any way I can just remove this? (I want to put my own buttons on the screen that will allow the view to be popped).
From the comments, you can hide the back button for a viewController by using its navigationItem property. (which is the UINavigationItem corresponding to that viewController in the stack of the navigationController. its how you control what shows up on the bar for specific view controllers (see Apple Doc here)).
To answer your question, set the navigationItem's hidesBackButton property to YES. Something like this probably called in your viewControllers viewDidLoad: or similar method.
myViewController.navigationItem.hidesBackButton = YES;
have you try with self.navigationItem.hidesBackButton=YES;?
If I wanted to do it, I'd hide the Navigation bar on push (non animated hide), add a toolbar, and add any custom stuff I want to the toolbar.
on popping the view controller, make sure to unhide the navigation bar. It'll work
I have a Tabbar application with a navigation controller (classic).
At some point when a url is selected a WebView controller is displayed with the appropriate url address.
I want to be able to use the tabbar area placing the webview over it. I tried
[self.tabBarController.tabBar setHidden:TRUE];
but this just makes the tabbar white.
How can i do this?
Teo
You can use theView.hidesBottomBarWhenPushed. Then when you push the view onto the navigation stack, the bottom bar (tab bar) will be hidden.
If you want to hide the tab bar from within the view itself, afaik the only way is to hide it by either using .hidden = YES or changing the frame. Then you need to change the frame (more specifically the height) of the view to fill the empty space.
Changing the height will not do anything because the tab bar is still sitting on top of the UIView which is holding the UIWebView. You need to do something to this extent:
[[[[UIApplication sharedApplication] delegate] window] addSubview:webView];
The only issue I am having now is that the webView is being pulled behind the UIView that is holding it. : (
I guess you can put an IBOutlet hook in there and perform a sendToBack on the UIView but I am going to keep searching for a better solution.
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
I'm experimenting with the NavBar sample project for iPhone. When I tap on one of the rows in the table in the default view a new view slides in (so far so good). I want to remove the UINavigationBar bar at the top of the new view that slides in. How can I do this?
EDIT: I meant "UINavigationBar". Thanks to everyone who responded!
Are you referring to the status bar (where the time and battery status are shown) or the UINavigationBar (where the title and Back buttons are)?
To hide the status bar, use [UIApplication sharedApplication].statusBarHidden = YES; in your -applicationDidFinishLaunching: method.
To hide the UINavigationBar, you'll want to use the navigationBarHidden property of your UINavigationController.
You can either hide it programmatically by called setHidesStatusBar on your UIApplication (sharedApplication), or you can set it in the plist. Check the CrashLanding's plist.
[[UIApplication sharedApplication]setHidesStatusBar:YES];