播放video全屏后iOS状态栏方向

在iOS 6.1.2上播放youtubevideo时遇到问题。 也就是说,在横向全屏模式下播放video(我的应用程序仅支持纵向模式),或者如果用户在播放video期间按完成,状态栏将不会旋转。 喜欢这个: 在此处输入图像描述

现在我注册UIMoviePlayerControllerDidExitFullscreenNotification观察者以更改状态栏的旋转,它在iOS 6.1及更低版本上正常工作,但在iOS 6.0.1中没有

如果我弄错了,请告诉我。 或者欢迎任何其他解决状态栏方向的解决方案。

  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeVideoExit:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil]; - (void)youTubeVideoExit:(id)sender { [[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO]; }