0
触摸可以指定自己获取触摸位置在自己的坐标系中,但是如何从另一个触摸位置获取触摸位置?说另一个UIview的坐标系?如何获取不同视图的触摸位置?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[UIView beginAnimations:@"box" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
UITouch *touch = [touches anyObject];
box.center = [touch locationInView:self];
[UIView commitAnimations];
}
难道我只是在一个不同的UIview的名称'自我'是?
是的,这工作正常。 – 2009-07-10 18:02:01