gpt4 book ai didi

iphone - 点击按钮时忽略 UIGestureRecognizer

转载 作者:可可西里 更新时间:2023-11-01 03:06:32 27 4
gpt4 key购买 nike

我设置了一个手势识别器,以便在点击屏幕时我的工具栏会向下滑动。当我点击栏上的按钮时,这算作轻击。在这些情况下如何取消手势?

谢谢

最佳答案

您可以查看 SimpleGestureRecognizers 示例项目。

http://developer.apple.com/library/ios/#samplecode/SimpleGestureRecognizers/Introduction/Intro.html

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {

// Disallow recognition of tap gestures in the button.
if ((touch.view == button) && (gestureRecognizer == tapRecognizer)) {
return NO;
}
return YES;
}

关于iphone - 点击按钮时忽略 UIGestureRecognizer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5942133/

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