-2

For some odd reason I cannot hide the back button from the navigation bar.

I've tried everything below, but nothing works.

Any other suggestions?

**The "Back" button appears, but nothing happens when pressed.

    self.navigationItem.leftBarButtonItem=nil;
    self.navigationItem.backBarButtonItem=nil;
    self.navigationItem.hidesBackButton=YES;
    self.navigationController.navigationItem.backBarButtonItem=nil;
    self.navigationController.navigationItem.leftBarButtonItem=nil;
    self.navigationController.navigationItem.hidesBackButton=YES;
Adam Cooper
  • 867
  • 1
  • 6
  • 23
  • Update your question with more details. Provide more details about your setup. What is your view controller/navigation controller setup? For which view controller do you want to hide the back button? And why? – rmaddy May 24 '15 at 01:01
  • would making an `IBOutlet` to the BackButton, then setting `BackButton.hidden = true` work? or try to disable the BackButton and set the alpha to 0 – Chameleon May 24 '15 at 01:23

1 Answers1

1

You can use the below code to hide back button:

[self.navigationItem setHidesBackButton:YES animated:YES];
Ali Riahipour
  • 524
  • 6
  • 20