这可能是我遇到过的最奇怪的问题,我什至不知道从哪里开始寻找 - 非常感谢任何帮助。
更新到 Xcode 6.3(和 iOS 8.3 SDK)后,在我的一个旧 OpenGL 应用程序中出现了一个新问题,在宽屏显示器上,任何 x 坐标触摸的上限为 320。这意味着如果我触摸高于 320 的 x 坐标,它将在触摸中注册为 320。
现在奇怪的是,这只发生在我的 touchesBegan 函数中EAGLView
——touchesMoved
并且touchesEnded
仍然可以检测到多达 568 个,即使它们具有完全相同的代码。
有谁知道这可能是什么原因造成的?以下是所有 3 个功能中使用的触摸代码:
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch *touch = [[event touchesForView:self] anyObject];
CGPoint _location;
_location = [touch locationInView:self];
// Flip the y location ready to check it against OpenGL coordinates
float temp = _location.x;
_location.x = _location.y;
_location.y = temp;
NSLog(@"Touched at (%f,%f)", _location.x,_location.y); }