1.通用取消侧滑手势,添加一个拖动手势覆盖侧滑
id traget = self.navigationController.interactivePopGestureRecognizer.delegate;
UIPanGestureRecognizer * pan = [[UIPanGestureRecognizer alloc]initWithTarget:traget action:nil];
[self.view addGestureRecognizer:pan];
2.页面有滑动操作,如地图拖动手势,如果使用上面的方法会让整个页面无滑动事件,此时可以使用FDFullscreenPopGesture的属性设置,在页面显示的时候设置为无侧滑操作,页面消失时还原。
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = YES;
}
网友评论