我设置了 MPMoviePlayerController 来播放电影。我想检测电影上的触摸以显示几个按钮。我使用了代码:
// The movie's window is the one that is active
UIWindow* moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
// Now we create an invisible control with the same size as the window
UIControl* overlay = [[[UIControl alloc] initWithFrame:moviePlayerWindow.frame]autorelease];
// We want to get notified whenever the overlay control is touched
[overlay addTarget:self action:@selector(movieWindowTouched:) forControlEvents:UIControlEventTouchDown];
// Add the overlay to the window's subviews
[moviePlayerWindow addSubview:overlay];
但是播放控制器没有出现,我猜是因为播放器窗口没有触摸到。我怎样才能保持播放器控制器并且仍然检测到触摸?谢谢