MPMoviePlayer无法正常工作

时间:2011-04-05 07:42:00

标签: iphone mpmovieplayercontroller

我对MPMoviePlayer有疑问。我正在使用[self presentModalViewController:moviePlayer animated:YES];来显示播放器。当我点击完成按钮

(void) moviePlayBackDidFinish:(NSNotification*)notification 
{    
  [[UIApplication sharedApplication] setStatusBarHidden:YES];

    // Remove observer
  [[NSNotificationCenter defaultCenter] removeObserver:self
                            name:MPMoviePlayerPlaybackDidFinishNotification 
                            object:nil];

    //[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];
    [self dismissModalViewControllerAnimated:YES];  
    //[self.view removeFromSuperview];

}

方法调用。当它导航到上一个视图时,前一个视图的x和y坐标会受到干扰,一切都会改变,意味着视图会发生变化。有什么建议 ?

2 个答案:

答案 0 :(得分:1)

尝试使用presentMoviePlayerViewControllerAnimated:dismisMoviePlayerViewControllerAnimated:方法,而不是使用presentModalViewController:animated: / dismissModalViewControllerAnimated:

答案 1 :(得分:0)

删除[[UIApplication sharedApplication] setStatusBarHidden:YES];代码解决了问题。