从捕捉每一个水龙头停止UITapGestureRecognize

从捕捉每一个水龙头停止UITapGestureRecognize

本文介绍了如何从捕捉每一个水龙头停止UITapGestureRecognizer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个OpenGL的看法和我有一个标签栏。我使用的是自来水识别,挖掘在屏幕上不同的3D对象。在标签栏我有一个按钮,但它不工作,因为水龙头识别捕获这些水龙头了。我该如何停止?我已经尝试过这样的:

 
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)的触摸
{
  如果([touch.view isKindOfClass:[的UIBarButtonItem类]])返回FALSE;
  返回TRUE;
}

我想我莫名其妙地比较错误类新,因为当我调试它总是返回TRUE。


解决方案


  如果([touch.view.superview isKindOfClass:[UIToolbar类]])返回FALSE;

这是我得到了它的工作。在上海华是一个UIToolbar,大概 UIBarButtonIttem 毕竟。

Hello I have an opengl view and on that I have a tab bar. I'm using a tap recognizer to tap different 3d objects on screen. In the tab bar I have a button but it doesn't work because the tap recognizer catches these taps too. How do I stop this? I've already tried this:


- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
  if ([touch.view isKindOfClass:[UIBarButtonItem class]]) return FALSE;
  return TRUE;
}

I think I am somehow comparing wrong classess because when I debug it returns TRUE always.

解决方案
  if ([touch.view.superview isKindOfClass:[UIToolbar class]]) return FALSE;

This is how I got it to work. The superview is a UIToolbar, probably UIBarButtonIttem is a view after all.

这篇关于如何从捕捉每一个水龙头停止UITapGestureRecognizer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 17:07