FDFullscreenPopGesture取消单页面侧滑操作

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;

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容