我正在为 iPad 开发 iOS 应用程序并使用 PageView 模板。我添加了一些播放一些视频文件的按钮。到目前为止一切正常,但问题是两个视图都调用了触摸手势。我的视图架构看起来像这样
我创建了一个 MPMovieViewcontroller,设置全屏模式并将视图添加到我的网页浏览中:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerFinished:) name:MPMoviePlayerDidExitFullscreenNotification object:nil];
mediaView = [[MPMoviePlayerViewController alloc] initWithContentURL:mediaURL];
mediaView.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
mediaView.moviePlayer.fullscreen = YES;
mediaView.moviePlayer.view.exclusiveTouch = YES;
[mediaView shouldAutorotateToInterfaceOrientation:YES];
[mediaView setWantsFullScreenLayout:YES];
[mediaView.moviePlayer prepareToPlay];
[mediaView.moviePlayer play];
[self.view addSubview:mediaView.view];
问题是,如果我尝试控制音量滑块,该手势会打开我的 MPMovieViewController 的超级视图的页面。我怎样才能避免这种情况?