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