当前ViewController需要关闭手势侧滑返回功能:
-(void)viewDidAppear:animated{
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]){
self.navigationController.interactivePopGestureRecognizer.enable = NO;
}
}
-(void)viewWillDisappear:animated{
[super viewWillDisappear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]){
self.navigationController.interactivePopGestureRecognizer.enable = YES;
}
}
本文介绍如何在iOS应用中暂时禁用手势侧滑返回功能。通过在ViewController的viewDidAppear和viewWillDisappear方法中控制UINavigationControllerInteractivePopGestureRecognizer的启用状态,实现特定页面的手势响应控制。
3729

被折叠的 条评论
为什么被折叠?



