ios 禁用某个页面导航手势返回

  • 内容
  • 评论
  • 相关

- (void)viewWillDisappear:(BOOL)animated {

    [super viewWillDisappear:YES];

    self.navigationController.interactivePopGestureRecognizer.enabled = YES;

}

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:YES];

    self.navigationController.interactivePopGestureRecognizer.enabled = NO;

}

 

需要在viewWillDisappear 添加 self.navigationController.interactivePopGestureRecognizer.enabled = YES;

否则可能会造成页面卡死情况。

评论

0条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注