I want to hide the rightNavigationBarItem when my ViewController loads. How is it possible? I have tried this code but it is not working.
self.navigationItem.rightBarButtonItem = nil;
Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
Question: Q: How to get rid of home button on iPhone screenGo to Settings > Accessibility > Touch, then select AssistiveTouch to turn it off. That is called Assistive Touch.
The option to disable Navigation bar can be set via Settings > Navigation Bar. When disabled, Home, Back, and Recents buttons will be removed from the screen, allowing more room for app use.
In Xcode 4. using these won't work;
self.navigationItem.leftBarButtonItem.enabled=NO;
self.navigationItem.leftBarButtonItem=nil;
self.navigationController.navigationBar.backItem.hidesBackButton=YES;
[self.navigationItem.leftBarButtonItem release];
I'm actually interested why you mention rightBarButtonItem? When you navigate, its the leftBarButtonItem that changes.
What Does Work;
1) self.title =@"";
nulling the title of the screen, when the navigation controller pushes a detail view onto the stack, no back button is created.
2) replacing the leftBarButtonItem
with something else changes the button, but doesn't solve your problem.
3) An alternative. Hide the navigation bar; [self.navigationController setNavigationBarHidden:YES animated:YES];
Hi it does not hide but make it disable
self.navigationItem.rightBarButtonItem.enabled = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With