Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable/Enable back button from detail view

Tags:

How can I disable the back button from the detail view controller?

like image 322
Zahi S. Avatar asked Aug 25 '12 14:08

Zahi S.


People also ask

How do I disable the Back button on my Iphone?

Yes, the back button can be disabled. Please navigate to Advanced Website Kiosk Settings–>Navigation–>Disable back button. Kindly enable this restriction to disallow the usage of the back button on the iOS device.


2 Answers

Depending on your configuration:

self.navigationItem.hidesBackButton = YES;

OR:

self.navigationController.navigationItem.hidesBackButton = YES;

Or, if you just want to disable the button without hiding it, you can use this.

self.navigationController.navigationItem.backBarButtonItem.enabled = NO;
like image 65
Mick MacCallum Avatar answered Sep 18 '22 19:09

Mick MacCallum


You can use the UINavigationItem hidesBackButton to hide it:

self.navigationItem.hidesBackButton = YES;
like image 40
gsempe Avatar answered Sep 21 '22 19:09

gsempe