我已经实施了interactivePopGestureRecognizer
. 它转换到上一页。但问题是,当转换发生时,如果UIScrollView
当前视图控制器中有一个,它就会开始滚动。有什么方法可以预防吗?
我在 RootViewcontroller 中添加了手势:
self.appNavController = [[UINavigationController alloc] initWithRootViewController:controller];
self.appNavController.interactivePopGestureRecognizer.enabled = YES;
self.appNavController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
[self.appNavController setNavigationBarHidden:YES];
我称之为:
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
APP_DELEGATE.rootViewController.appNavController.interactivePopGestureRecognizer.enabled = NO;
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
APP_DELEGATE.rootViewController.appNavController.interactivePopGestureRecognizer.enabled = YES;
}