我有一个UIImageView在(而不是一个元素) a 之上UIScrollView。好吧,我已经UIImageView将检查触摸事件的子类化并覆盖了该touchesBegan:withEvent:方法。在该方法中,我基本上将子类发送到元素UIImageView后面。UIScrollView(我[self.super bringSubviewToFront: scrollView]用来实现这一点)。
我想要的是能够将当前的触摸事件发送UIImageView到UIScrollView元素,这样用户就不必抬起手指并再次触摸来滚动。我已经尝试调用touchesBegan:withEvent:该UIScrollView元素,但它什么也没做。
有谁知道应该做什么,以便我可以模拟对UIImageView元素UIScrollView的触摸?
这是子类中的重写方法UIImageView:
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan: touches withEvent: event];
ViewController* controller = [Singleton getSingleton].controller;
[super bringSubviewToFront: controller.scrollView]; //Now scroll view is in the front
[controller.scrollView touchesBegan: touches withEvent: event]; //Does nothing
}