Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide Navigation Controller in Root View?

Please, help me to hide navigation controller in root view. I've found the solution to write [navigationController setNavigationBarHidden:YES] in every view controller which I need. Well, it works but only for the first time: I run application, in root view I don't have navigation, then I go to the second view – the navigation appears, OK. But then I press "Back" in navigation controller, and navigation from root view hasn't disappear. I work with xib.

like image 697
Alexander Yakovlev Avatar asked Oct 17 '13 08:10

Alexander Yakovlev


People also ask

How do I hide Navigationitem?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Full screen gestures”. The navigation bar will be hidden and you will be shown “Gesture demos” to explain how to operate the “Go back”, “Go to Home screen” and “Open Recents” functions.

How do I get rid of the transparent navigation bar?

If you want to remove the opacity or transparency from the sticky navigation bar, just navigate to Theme Options -> General -> Additional CSS and copy/paste this code and save changes. You could also manipulate the opacity by altering the value “1” at the end of the CSS statement.

How do I know if my view controller is root view controller?

Accessing the Root View Controller But it's easy to do. The root view controller is simply the view controller that sits at the bottom of the navigation stack. You can access the navigation controller's array of view controllers through its viewControllers property.


1 Answers

In rootViewController

-(void)viewWillAppear:(BOOL)animated
{
     [self.navigationController setNavigationBarHidden:YES animated:NO];
}

In second View(next to rootViewController)

-(void)viewDidLoad:(BOOL)animated
 {
    [self.navigationController setNavigationBarHidden:NO animated:NO];
 }
like image 181
Rocker Avatar answered Oct 16 '22 03:10

Rocker