这是我如何解决它。当视频进入全屏模式时,我改变了模态视图控制器的大小。
- (无效)movieDidEnterFullscreen:(NSNotification *)通知{
NSLog(@"did enter");
self.navigationController.view.superview.frame = CGRectMake(0, 0, 1500,1500);
self.navigationController.view.superview.center = self.view.center;
[mpviewController moviePlayer].controlStyle = MPMovieControlStyleDefault;
}
- (无效)movieDidExitFullscreen:(NSNotification *)通知{
NSLog(@"did exit");
UIDevice *device = [UIDevice currentDevice];
[device beginGeneratingDeviceOrientationNotifications];
if (([device orientation] == UIDeviceOrientationLandscapeLeft) || ([device orientation] == UIDeviceOrientationLandscapeRight)){
self.navigationController.view.superview.frame = CGRectMake(0, 0, 620,540);
self.navigationController.view.superview.center = CGPointMake(384, 512);
}
else {
self.navigationController.view.superview.frame = CGRectMake(0, 0, 540,620);
self.navigationController.view.superview.center = CGPointMake(384, 512);
}
[mpviewController moviePlayer].controlStyle = MPMovieControlStyleEmbedded;
}
我终于明白了。它只在里面工作,因为电影播放器在模态视图内,只允许在视图内部进行交互。该视频完全全屏显示,因此交互只发生在模态视图所在的位置。为了解决这个问题,我使用电影播放器通知在进入全屏和退出全屏时更改了模式视图大小。 – Pete42 2011-06-23 05:47:57