Iphone MPMoviePlayer未旋转

Iphone MPMoviePlayer未旋转,iphone,ios,ios5,mpmovieplayer,Iphone,Ios,Ios5,Mpmovieplayer,在我的应用程序中,我有一个UIWebview,其中显示了视频链接列表。点击其中一个链接,MPMoviePlayer就会自动启动。但在全屏模式下,它不会在需要时旋转 现在如何旋转它,因为我在webview中无法控制它。如果您使用的是IOS 6,请使用-(void)将旋转到InterfaceOrientation:(UIInterfaceOrientation)到InterfaceOrientation持续时间:(NSTimeInterval)持续时间{} 因为ios 6不再提供shouldauto

在我的应用程序中,我有一个UIWebview,其中显示了视频链接列表。点击其中一个链接,MPMoviePlayer就会自动启动。但在全屏模式下,它不会在需要时旋转


现在如何旋转它,因为我在webview中无法控制它。

如果您使用的是IOS 6,请使用
-(void)将旋转到InterfaceOrientation:(UIInterfaceOrientation)到InterfaceOrientation持续时间:(NSTimeInterval)持续时间{}

因为ios 6不再提供shouldautorotate。

AppDelegate.m
文件中发布此方法

    -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
         return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;    
    }

对于iOS6,您还应该确保在info.plist上支持的界面方向键中添加了横向。您的意思是横向模式不工作吗?是的。视频仅限于纵向模式。是否尝试以下代码?-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{返回YES;}@WakkaoW也试试这个答案都德:)