這是我如何解決它。當視頻進入全屏模式時,我改變了模態視圖控制器的大小。
- (無效)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