小编jac*_*cky的帖子

获取触摸坐标(以0-480和0-320的形式)

我不知道如何翻译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)

我想通过触摸和拖动来调整图像大小(仅限高度)

iphone touch coordinate-systems

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

coordinate-systems ×1

iphone ×1

touch ×1