我不知道如何翻译iPhone的坐标.
如果我单击一下我就会得到坐标.
如果我触摸并保持并释放它,它会显示起点和终点的差异.
我如何获得触摸的绝对位置?
谢谢!
-(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);
}
Run Code Online (Sandbox Code Playgroud)
我想通过触摸和拖动来调整图像大小(仅限高度)