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];
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 have a UITableView with some Cells.
I don't use NavigationController, so I'd like to use UIModalTransition to Switch from RootController, my TableViewcell, to my DetailView, but want to add a Navigation bar to attribute some actions, like Backbutton.
I don't want to use seguesTransition, I only used XIB File and any Storyboard.
I really don't know how to use the Modal Transition in TableView, anyone know how i can do it ?
Thanks.
have you tried
[self presentModalViewController:yourViewController animated:YES];
then you can set certain styles for transitions in it.
On the other view add a navigationbar and place a backbarbuttonitem and add an action to it to go back to your previous view.
Although why do you want to do it is unclear to me.
if you dont want a navigation controller on the first view, you can just set it to hidden.
self.navigationController.navigationBar.hidden = YES;
and then in the viewDidLoad of other view you can do the reverse i.e
self.navigationController.navigationBar.hidden = NO;
this is quite an easy way of achieving what you want with relatively less amount of code!!
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 have an application with a tab bar and a navigation bar. I push a view controller that is used to show photos, one at a time. It initially shows the bars and forward/back controls; after a delay, these hide, using setNavigationBarHidden:animated: and a custom transform (CGAffineTransformMakeTranslation) on the tab bar. This works, but the view controllers view , which shows the photo, leaps up and down. The same is true if I leave the tab bar out of the equation.
How can I prevent the UINavigationBar from moving my view around? I would like the photo to stay fixed in the screen, with the nav bar dropping down over the top segment of it.
Had this issue and fixed it with a class that inherited from UINavigationController
-(void)viewWillAppear:(BOOL)animated
{
self.navigationBar.translucent = YES;
}
Worked great for me, didn't had to set style to UIBarStyleBlackTranslucent. So it did kept my colors.
[[navigationController navigationBar] setBarStyle:UIBarStyleBlackTranslucent];
[[navigationController navigationBar] setAutoresizesSubviews:NO];
this seemed to do the trick for me!
I know this is an old question, but I accomplished that by disabling 'Autoresize Subviews' in Interface Builder
I haven't been able to find a proper way to handle this except to set the navigationBar style to translucent as in:
theNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
Other than creating another navigation bar and adding buttons to them, that's the best (and it seems to be what Apple does as well in it's Photo app)