导航后退按钮在View Controller中不可见

时间:2018-10-08 10:34:54

标签: objective-c back-button

我在视图控制器中使用了自定义后退按钮。但是它不可见。请帮助我。 这是我的代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:@"GDPR Privacy Policy"];
    [attributedString addAttribute: NSLinkAttributeName value: @"https://privacypolicies.com/privacy/view/f5904d8b8bf9b0064592688552be71bc" range: NSMakeRange(0, attributedString.length)];
    self.lbl.attributedText = attributedString;
    self.Background_View.layer.cornerRadius = 10;
    self.Background_View.layer.borderWidth = 1;
    self.Background_View.layer.borderColor = [UIColor blackColor].CGColor;

    self.navigationItem.leftItemsSupplementBackButton = YES;
    [StaticHelper setLocalizedBackButtonForViewController:self];
     // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)back_action_btn:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

My Storyboard

2 个答案:

答案 0 :(得分:1)

您总是会看到上一个视图控制器的后退按钮。如果将另一个视图控制器推到该视图控制器的顶部, then ,您将看到此后退按钮。

答案 1 :(得分:-1)

好吧,您不能在默认导航栏上添加自定义后退按钮。您必须在StoryBoard或Xib文件上获取UIView,然后使用界面生成器或以编程方式添加自定义后退按钮。我正在为您提供一张图像供您参考,以便您对此有所了解。 谢谢 enter image description here