1
我不明白为什么一个CAShapeLayer并不则hitTestCAShapeLayer则hitTest触摸
回应此功能总是转到//触摸超出
如何检测在CAShapeLayer触摸?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { currentPoint = [[touches anyObject] locationInView:self]; for (CAShapeLayer *layer in self.layer.sublayers) { if(layer == shapeLayer) { if([layer hitTest:currentPoint]) { // touche is on the layer } else { // touche is outside } } } }
效果很好。感谢分享!。 – Vignesh 2011-10-11 04:37:58