我的 iOS 应用程序窗口顶部的导航栏和底部的工具栏之间有一个 GLKView (OpenGL ES2.0)。我已经使用 UIPinchGestureRecognizer 实现了捏缩放,但是当我缩小很大程度时,我的视图会在顶部导航栏上运行。令人惊讶的是,视图并没有越过底部的工具栏。想知道我做错了什么。
这是我正在使用的视口设置:
glViewport(0, 0, self.frame.size.width, self.frame.size.height);
这是更新和捏处理程序:
-(void) update {
float aspect = fabsf(self.bounds.size.width / self.bounds.size.height);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f),aspect, 0.01f, 10.0f);
self.effect.transform.projectionMatrix = projectionMatrix;
GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -6.0f);
modelViewMatrix = GLKMatrix4Multiply(modelViewMatrix, _rotMatrix);
self.effect.transform.modelviewMatrix = modelViewMatrix;
}
-(IBAction) handlePinch: (UIPinchGestureRecognizer *)recognizer {
recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
recognizer.scale = 1.0;
}