我有一个 View ,我想让用户在点击 UIButton
后在上面绘图,我已经使用 UIPanGestureRecognizer
做到了这一点,添加了一个 UIPanGestureRecognizer
这个 View 在 UIButton
触摸之后,但问题是我如何在完成绘图并重新触摸 UIButton
之后删除这个 UIPanGestureRecognizer
> ??
最佳答案
UIView 有一个方法叫做
- (void)removeGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
或者,您可以通过使用方法移除其回调来临时禁用 UIGestureRecognizer
- (void)removeTarget:(id)target action:(SEL)action
关于iphone - 添加到 View 后删除 UIPanGestureRecognizer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7873636/