MPMoviePlayerController在iPad中全屏怪癖

hpi*_*que 13 fullscreen statusbar mpmovieplayercontroller screen-orientation ipad

我想在视图控制器中显示MPMoviePlayerController,并让用户使用默认控件(如YouTube应用程序)切换全屏.我在一个简单的例子中使用以下代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    self.player = [[MPMoviePlayerController alloc] init];
    self.player.contentURL = theURL;
    self.player.view.frame = self.viewForMovie.bounds;
    self.player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.viewForMovie addSubview:player.view];
    [self.player play];
}
Run Code Online (Sandbox Code Playgroud)

这很有效,直到用户将视频全屏显示,旋转设备并点击屏幕.状态栏显示在错误的位置,如下面的屏幕截图所示.

截图

我正在使用模板Tab Bar Application for iPad.我只添加了上面的viewDidLoad,视图变量和XIB中的UIView来显示电影播放器​​.

我究竟做错了什么?

smo*_*tle 2

对于所有受支持的方向,shouldAutorotateToInterfaceOrientation:interfaceOrientation 是否返回 YES?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    返回是;
}

如果您提供更多代码将会有所帮助。