iOS 7 backBarButtonItem hidden

2019-06-20 05:28发布

I've an issue with back bar button. It stay hidden no matter that i do like self.navigationItem.hidesBackButton

Here is my code to add back 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];
}

Button stay hidden BUT going back works if if touch on the place where it should be. Of course it works on iOS6. Another detail: back button seems to appear when i set UINavigationBar translucent to YES.

Thanks

3条回答
老娘就宠你
2楼-- · 2019-06-20 06:06

Use this code:

self.navigationItem.backBarButtonItem = nil;

OR

self.navigationItem.leftBarButtonItem = nil;
查看更多
戒情不戒烟
3楼-- · 2019-06-20 06:14
[self.navigationItem setHidesBackButton:YES];

Check out this.

查看更多
Summer. ? 凉城
4楼-- · 2019-06-20 06:22
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
查看更多
登录 后发表回答