【问题标题】:touchtouchEnded is not getting called after touchesBegan and touchMovedtouchtouchEnded 在 touchesBegan 和 touchMoved 之后没有被调用
【发布时间】:2009-11-30 23:06:44
【问题描述】:

我有一种奇怪的触摸效果。有时,当我慢慢滑动屏幕时,会调用 touchBegan 和 touchMoved 但不会调用 touchEnded,这有点搞砸了我的视图移动。 touchEnded 怎么可能不被调用?我的手指离开屏幕而没有从侧面或类似的东西上跑出来!! 任何提示或建议来解释这种行为?我真的需要 touchEnded 来清理我的视图。

感谢您的任何建议。 铝

【问题讨论】:

    标签: iphone cocoa-touch events touchscreen


    【解决方案1】:

    我怀疑在这些情况下你接到了touchesCancelled:withEvent: 的电话,而touchesEnded:withEvent: 没有被调用。你实现了那个方法吗?

    【讨论】:

    • 确实如此。在 iTunes 上的 iPhone 编程视频课程中,有一位 Apple 工程师对触控事件进行了客座演讲。我强烈推荐它。
    • 感谢您的回复。我也实现了 touchCancelled:withEvent 并且它没有被调用。还有其他原因导致事件可能会被取消、删除或未发送吗???
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多