0

这是我的代码:

-(void) playVideo
{
    self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:self.criteriaFilter.videoUrl];
    [self.moviePlayer prepareToPlay];
    [self.moviePlayer.view setFrame:self.displayVideoView.bounds];
    self.moviePlayer.shouldAutoplay = YES;
    [self.displayVideoView addSubview:self.moviePlayer.view];

}

在纵向模式下,控件工作正常(播放、暂停、全屏)。但是在横向模式下,所有按钮似乎都被禁用了。我该如何解决这个问题?

4

1 回答 1

2

对于您在评论中描述的问题,可以通过在您的代码中添加此代码来解决。

self.moviePlayer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
于 2013-02-27T12:48:26.123 回答