我想在UIPanGestureRecognizer
回调期间更改UIView。例如:
- (void)handleScroll:(UIPanGestureRecognizer *)recognizer
if (recognizer.state == UIGestureRecognizerStateBegan){
self.subview.userInteractionEnabled = NO;
} else if (recognizer.state == UIGestureRecognizerStateEnded){
self.subview.userInteractionEnabled = YES;
}
}
这在UIPanGestureRecognizer
回调中从未奏效,但如果我在initWithFrame
方法中编写代码
我也尝试在回调中使用performSelectorOnMainThread:<#(SEL)#> withObject:<#(id)#> waitUntilDone:<#(BOOL)#>
,但它都没有用。
对手势识别器回调中你不能做什么有什么限制吗?
答案 0 :(得分:0)
我在UIGestureRecognizer中意外将cancelsTouchesInView
设置为NO
。将其更改为YES可解决问题。