我正在开发 iPhone 应用程序,但手势识别器有问题。
我在视图上添加了一个 UITapGestureRecognizer,然后我使用 CABasicAnimation 转换与该视图相关的图层。经过这个变换后,手势识别器只在变换前的视图占据的区域内工作。
希望我的问题的这个小描述是可以理解的..
这是一些代码:
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(myViewTapped:)];
[self.myView addGestureRecognizer:tapGestureRecognizer];
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"position.y"];
[animation setFromValue:[NSNumber numberWithFloat:0]];
[animation setToValue:[NSNumber numberWithFloat: - 100]];
[animation setDuration:.3];
[animation setTimingFunction:[CAMediaTimingFunction functionWithControlPoints:.55 :-0.25 :.30 :1.4]];
animation.additive = YES;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[self.myView.layer addAnimation:animation forKey:nil];
我该如何处理这个问题?
谢谢 !