gpt4 book ai didi

iphone - 关于来自 UITapGestureRecognizer 的消息

转载 作者:可可西里 更新时间:2023-11-01 06:18:51 26 4
gpt4 key购买 nike

以下内容来自文档:

Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the associated action message is sent when the gesture begins and is sent for each intermediate state until (and including) the ending state of the gesture.

上面这段话似乎表明发送了不止一条消息。消息将包括“开始”消息和“结束”消息。但不知何故,我只是收到“手势结束”消息。有什么办法可以让我同时获得点击开始和结束消息吗? (我想跟踪的是 - “开始”:用户触摸屏幕的那一刻和“结束”:用户将手指从屏幕上移开的那一刻。)

希望有这方面知识的人能帮忙...

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITapGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UITapGestureRecognizer

最佳答案

UITapGestureRecognizer 仅在手势状态为 UIGestureRecognizerStateEnded 时触发

如果您想使用手势识别器来检测按下的开始和结束,请使用 UILongPressGestureRecognizer,并将 minumumPressDuration 设置为 0

关于iphone - 关于来自 UITapGestureRecognizer 的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7566812/

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