How to hide the “back” button in UINavigationController?

前端 未结 14 2387
盖世英雄少女心
盖世英雄少女心 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:08

    In my UIViewController subclass I have this method:

    -(void)setEditing:(BOOL)editing animated:(BOOL)animated {
        [super setEditing:editing animated: animated];
    
        // hide back button in edit mode
        [self.navigationItem setHidesBackButton:editing animated:YES];
    }
    

提交回复
热议问题