gpt4 book ai didi

ios - 如何重置 UIPanGestureRecognizer?调用 "reset"会生成 "Value of type ' UIPanGestureRecognizer' has no member 'reset' ”错误

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

UIGestureRecognizer 的文档引用重置函数。

但是,在 UIPanGestureRecognizer(UIGestureRecognizer 的子级)上调用 reset() 会生成此错误消息:

Value of type 'UIPanGestureRecognizer' has no member 'reset'

如何在“已更改”状态期间重置 UIPanGestureRecognizer

最佳答案

如果 UIPanGestureRecognizer 被称为 recognizer,您可以通过以下方式重置它:

recognizer.setTranslation(CGPoint(x: 0, y: 0), in: recognizer.view!)

关于ios - 如何重置 UIPanGestureRecognizer?调用 "reset"会生成 "Value of type ' UIPanGestureRecognizer' has no member 'reset' ”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49417776/

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