sujith1406
sujith1406

Reputation: 2822

How to hide the backbutton in uinavigationcontroller

I tried to remove the backbutton of uinavigationcontroller by using

appdelegate.navigationController.navigationItem.hidesBackButton=YES;

but it does not remove the backbutton after the pushing a new viewcontroller into navigation stack.How to hide this?

Upvotes: 2

Views: 4902

Answers (4)

Owen Pierce
Owen Pierce

Reputation: 783

The existing answers didn't work for me. I found that the best way for me was:

self.navigationItem.leftBarButtonItems = [NSArray array];

Upvotes: 0

SoftSan
SoftSan

Reputation: 2472

You can write this in your ViewDidLoad as well as in ViewWillAppear method:

self.navigationItem.hidesBackButton = YES;

Upvotes: 0

Surjit Joshi
Surjit Joshi

Reputation: 3515

Your above line is wrong. do it with :

 self.navigationController.navigationItem.hidesBackButton = TRUE;

Upvotes: 2

agilityvision
agilityvision

Reputation: 7931

In the view controller's viewDidLoad method that you want to hide the back button:

self.navigationItem.hidesBackButton = YES;

Upvotes: 12

Related Questions