将MPMoviePlayerController旋转到横向-iPhone SDK

将MPMoviePlayerController旋转到横向-iPhone SDK,iphone,objective-c,mpmovieplayercontroller,rotation,landscape,Iphone,Objective C,Mpmovieplayercontroller,Rotation,Landscape,我试图将我的MPMoviePlayerController旋转到横向视图,但它始终处于纵向模式。我在UIViewController中执行此操作,但在全屏模式下仍然无法旋转MPMoviePlayerController。我必须对shouldAutorotateToooritation方法做些什么吗?如果有人知道怎么做,请留下回复 谢谢 凯文来自: 默认情况下,UIViewController类仅以纵向模式显示视图。要支持其他方向,必须重写shouldAutorotateToInterfaceOr

我试图将我的MPMoviePlayerController旋转到横向视图,但它始终处于纵向模式。我在UIViewController中执行此操作,但在全屏模式下仍然无法旋转MPMoviePlayerController。我必须对shouldAutorotateToooritation方法做些什么吗?如果有人知道怎么做,请留下回复

谢谢

凯文

来自:

默认情况下,UIViewController类仅以纵向模式显示视图。要支持其他方向,必须重写shouldAutorotateToInterfaceOrientation:方法,并为子类支持的任何方向返回YES。如果视图的自动调整大小属性配置正确,您可能只需要这样做。但是,UIViewController类为您提供了额外的钩子,以根据需要实现额外的行为


例如,如果您的
autoresizingMask
设置为
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
,并且电影播放器视图的父视图具有
autoresizesSubviews=YES
,然后从shouldAutorotateToInterfaceOrientation返回YES可能就是您所需要做的一切。

我发现这种方法非常有用,但设置所需帧需要花费时间-

theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; 
// Rotate the view for landscape playback   
[[theMovie view] setBounds:CGRectMake(-230, 155, 480, 350)];
[[theMovie view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)]; 

谢谢,但我已经通过将我的视图调整为lanscape维度并旋转我的MPMoviePlayerController手动使其工作。但现在我已经导致了一个问题,当我启用[moviePlayer setControlStyle:MPMovieControlStyleFullScreen]时,我的“完成”按钮不起作用;