1

我正在使用MPMoviePlayerControllerUITabbarcontroller但我不知道为什么它不自动旋转

这是我的代码:

NSURL *url = [NSURL URLWithString: [dt objectForKey:@"TrailerPath"]];

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

    moviePlayer.shouldAutoplay = YES;  
    moviePlayer.view.frame = [[UIScreen mainScreen] applicationFrame];
    moviePlayer.view.transform = CGAffineTransformMakeRotation(1.57079633);
    moviePlayer.view.bounds = CGRectMake(0.0, 0.0, 480, 320);        
[[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(moviePlayBackDidFinish:)
                                                     name:MPMoviePlayerPlaybackDidFinishNotification
                                                   object:moviePlayer];
[moviePlayer prepareToPlay];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
4

1 回答 1

0

您是否在项目设置中为您的项目设置了支持的界面方向?

编辑:您可以在此处设置支持的界面方向:在此处输入图像描述

于 2013-01-23T08:24:18.037 回答