IOS 7 backBarButtonItem hidden

I have a problem with the bar button. It stays hidden no matter what I like self.navigationItem.hidesBackButton

Here is my code to add a return button:

 // - (void)viewDidLoad{ [.....]; UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"UI_BTN_BACK", nil) style:UIBarButtonItemStylePlain target:nil action:nil]; back.tintColor = [Templates getColor:@"color"]; [[self navigationItem] setBackBarButtonItem:back]; // Parent [super viewDidLoad]; } 

The button remains hidden, but returns if you touch the place where it should be. Of course, it works on iOS6. Another detail: the back button appears when I set the UINavigationBar translucent to YES.

thanks

+6
source share
3 answers

Use this code:

 self.navigationItem.backBarButtonItem = nil; 

OR

 self.navigationItem.leftBarButtonItem = nil; 
+1
source
 [self.navigationItem setHidesBackButton:YES]; 

Check this.

+4
source
 self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; 
+1
source

Source: https://habr.com/ru/post/954400/


All Articles