gpt4 book ai didi

ios - 如何在 UIScrollView 中使用系统弹出手势?

转载 作者:行者123 更新时间:2023-11-29 02:00:51 29 4
gpt4 key购买 nike

我在UINavigationController中有一个UIScrollView,但我发现当我触摸scrollView时无法使用系统的弹出手势,我应该如何解决冲突?

最佳答案

已修复,自定义左侧导航项导致此问题,我添加代码

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}

但在某些情况下仍然不起作用,应该修改为

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
return YES;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
return [gestureRecognizer isKindOfClass:UIScreenEdgePanGestureRecognizer.class];
}

关于ios - 如何在 UIScrollView 中使用系统弹出手势?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30408581/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com