我沒有得到如何翻譯iphone的座標。獲取觸摸座標(以0-480和0-320的形式)
如果我做了一個單一的觸摸我得到的座標。
如果我觸摸並保持並釋放它,它會顯示出發點和終點的區別。
我如何獲得觸摸的絕對位置?
謝謝!
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
NSLog(@"X: %f",location.x);
NSLog(@"Y: %f",location.y);
}
我想與
您應該添加代碼獲取座標 – Francescu 2009-11-15 12:09:40