cdub
cdub

Reputation: 25731

Hiding a UINavigationController on start page

Hi I have a navigationController that starts with a view controller in which in viewDidLoad has:

 self.navigationController.navigationBarHidden = YES;

I click a button on that page and it transitions to a second view controller in which I put:

self.navigationController.navigationBarHidden = NO;

This works fine until I click the Back button in the navigation bar. How do I keep the navigation bar permanently off the start page but not the transitioned one?

Upvotes: 0

Views: 99

Answers (2)

Jitendra
Jitendra

Reputation: 5081

-(void)viewWillAppear:(BOOL)animated
{

    self.navigationController.navigationBarHidden=YES;
}

Add this code in your .m file whwre you hide the navigation controller.

Upvotes: 1

thatzprem
thatzprem

Reputation: 4767

Add self.navigationController.navigationBarHidden = YES; in the viewWillAppear of the firstViewController.

You are adding hidden action in the viewDidLoad method which is called once as the viewControllers in navigation stack are not unloaded when your push to the nextViewController.

Upvotes: 3

Related Questions