I have tried to hide the back button in my navigation controller by adding the following lines to my viewDidLoad
method. Many other previous answers on SO have said this works, so I don't know what my problem is? Maybe something new with iOS 7 / Xcode 5?
self.navigationItem.hidesBackButton = YES;
self.navigationController.navigationItem.hidesBackButton = YES;
I too had faced similar issue.
This will work only when you have not customized your Navigation bar
.
Either one of the below one will work.
[self.navigationItem setHidesBackButton:YES animated:YES]; OR
[self.navigationItem setHidesBackButton:YES];
Please check whether your getting "Back" in iOS 7
, then the above will work.
Hope this will help you to identify the issue
In UINavigationController
we can hide Like this:
[self.navigationItem setHidesBackButton:YES animated:YES];
And In UITabBarController
we can Hide Like this:
self.tabBarController.navigationItem.hidesBackButton = YES;
self.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc] init]];
Use following code :
[self.navigationItem setHidesBackButton:YES animated:YES]; // hide back button
[self.navigationItem setBackBarButtonItem:nil]; // set as nil
[self.navigationItem setLeftBarButtonItem:nil animated:NO]; // left bar item as nil