【发布时间】:2013-05-18 05:45:33
【问题描述】:
我有一个覆盖视图(覆盖整个屏幕),我可以接收触摸,但它不会将它们传递给响应者链。
我这样添加子视图:
UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow];
[mainWindow insertSubview:self.view aboveSubview:mainWindow];
我使用 addSubview 还是 insertSubview 似乎并不重要。
我的 touchesBegan 看起来像:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//do some stuff here..
[super touchesBegan:touches withEvent:event];
}
我是否使用 SUPER 或 self.nextResponder 等的各种其他组合似乎并不重要。
最后,我需要一个覆盖整个屏幕的覆盖视图,我需要检测触摸然后将它们传递给它们下面的视图/视图控制器。
谢谢!
【问题讨论】:
标签: objective-c uiview subview uiwindow uiresponder