QueueOverFlow QueueOverFlow - 1 year ago 120
iOS Question

How to hide navigation bar back button

My question is simple, How to hide back button in navigation bar? I see similar question here in stack overflow but

self.navigationItem.hidesBackButton = YES;

not working for me. I am using below code because RootViewController is my Singleton class.


i still use both in viewDidLoad but both are not working

[RootViewController sharedFirstViewController].navigationItem.hidesBackButton = YES;

[RootViewController sharedFirstViewController].navigationItem.backBarButtonItem=nil;

Answer Source

Try self.navigationItem.backBarButtonItem.hidden = YES; or self.navigationItem.backBarButtonItem = nil;

Place one of these either in viewWillAppear:, viewWillLoad or viewDidAppear: of the class you want to get rid of the back button in.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download