How to hide the “back” button in UINavigationController?

前端 未结 14 2372
盖世英雄少女心
盖世英雄少女心 2020-12-04 07:09

Do you know how to hide the \'back\' button in a UINavigationController? Also, how to show it back, but I guess that\'s very similar to hiding it...

Just like the ma

相关标签:
14条回答
  • 2020-12-04 08:14

    Add this Code

    [self.navigationItem setHidesBackButton:YES];
    
    0 讨论(0)
  • 2020-12-04 08:14

    Always use Apple Documentation for simple issues they are more straightforward and lightweight :)

    Here is the syntax for Swift 3.0:

    self.navigationItem.setHidesBackButton(true, animated:true)
    

    Reference

    https://developer.apple.com/reference/uikit/uinavigationitem#//apple_ref/occ/instm/UINavigationItem/setHidesBackButton:animated:

    0 讨论(0)
提交回复
热议问题