Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 GLKView 顶部有一个按钮。当我单击按钮时,我还会在按钮后面的 GLKView 上收到一个长触摸通知。
如何防止通知传播到视图?
找到了我的问题的解决方案。以下代码可以解决问题:
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { UIView* viewRceivingTouch = touch.view; return (viewRceivingTouch == self.glkView); }