我没有得到如何翻译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