Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 211
sujith1406 Avatar asked Aug 31 '26 23:08

sujith1406


2 Answers

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

self.navigationItem.hidesBackButton = YES;
like image 54
agilityvision Avatar answered Sep 03 '26 14:09

agilityvision


Your above line is wrong. do it with :

 self.navigationController.navigationItem.hidesBackButton = TRUE;
like image 42
Surjit Joshi Avatar answered Sep 03 '26 16:09

Surjit Joshi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!