Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 两个视图可以处理一次触摸吗?_Iphone_Uiview - Fatal编程技术网

Iphone 两个视图可以处理一次触摸吗?

Iphone 两个视图可以处理一次触摸吗?,iphone,uiview,Iphone,Uiview,比如说,我有两个重叠的UIView层: ----view-top --view-below 当我触摸屏幕时,我希望触摸由这两个视图处理,而不仅仅是一个视图 我该怎么做呢?试试这个: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self.nextResponder touchesBegan:touches withEvent:event]; } 这会将触摸发送到链中的下一个响应者,在这种情况

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

----view-top
  --view-below
当我触摸屏幕时,我希望触摸由这两个视图处理,而不仅仅是一个视图

我该怎么做呢?

试试这个:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesBegan:touches withEvent:event];
}
这会将触摸发送到链中的下一个响应者,在这种情况下,是您的视图

试试这个:

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

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

你试过吗?你如何处理触摸?触摸开始/。。。或者手势识别器?你试过吗?你如何处理触摸?触摸开始/。。。还是手势识别器?