2011-01-10 83 views
0

我有一个UIView和几个图像视图作为UIView上的子视图。我需要实现这种情况,“当在视图上触摸图像视图时,其他图像视图触摸事件将不会传送”。独家Touch在UIView上无法在UIView和多个图像视图上工作

我使用UIView的独家触摸属性,但是当我触摸其中一个子视图时,我同时触摸了其他子视图的触摸事件也提供触摸事件。 我还为所有视图设置了多点触控禁用。

回答

0
for (UITouch *touch in touches) 
{ 
    currentTouch=touch; 

    if (CGRectContainsPoint([self.view frame], [touch locationInView:self.image1view])) 
    { 
     Give desired action here…. 
     [self transformSpinnerwithTouches:touch]; 
    } 
    else 
     if (GRectContainsPoint([self.view frame], [touch locationInView:self.imageview2])) 
     { 
      Give desired action here as well…. 
      [self dispatchTouchEvent:[touch view]WithTouch:touch]; 
     } 
}