最近在tableview里的cell imageview加了个 uipangesturerecognizer发现优先滚动imageview,往上拖的时候,tableView不响应滚动了,原来是tableview的实现也是用了uipangesturerecognizer。解决方案如下:
实现 UIGestureRecognizerDelegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
return YES;//uitableview和子view也响应 no只响应子view uipangesturerecognizer
}
时间: 2024-10-16 17:54:16