Disable/Enable back button from detail view

前端 未结 2 1155
一个人的身影
一个人的身影 2020-12-18 18:57

How can I disable the back button from the detail view controller?

相关标签:
2条回答
  • 2020-12-18 19:25

    Depending on your configuration:

    self.navigationItem.hidesBackButton = YES;
    

    OR:

    self.navigationController.navigationItem.hidesBackButton = YES;
    

    Or, if you just want to disable the button without hiding it, you can use this.

    self.navigationController.navigationItem.backBarButtonItem.enabled = NO;
    
    0 讨论(0)
  • 2020-12-18 19:42

    You can use the UINavigationItem hidesBackButton to hide it:

    self.navigationItem.hidesBackButton = YES;
    
    0 讨论(0)
提交回复
热议问题