2

说,我有两个重叠的 UIView 层:

----view-top
  --view-below

当我触摸屏幕时,我希望通过这两个视图来处理触摸,而不仅仅是一个。

我怎样才能做到这一点?

4

1 回答 1

4

尝试这个:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesBegan:touches withEvent:event];
}

这会将触摸发送到链中的下一个响应者,在这种情况下,是您的视图!

于 2012-06-26T07:57:23.857 回答