2012-12-03 53 views
0

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

如何旋转它,因为我无法控制它在web视图中。

+0

景观模式不工作你的意思是? –

+0

是的。视频仅限于肖像模式 – WakkaoW

+0

您是否尝试过下面的代码? - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {YES;};}; } –

回答

2

,如果你使用的是iOS 6中使用- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {} 因为shouldautorotate没有任何更多的支持iOS 6

0

后这个方法在AppDelegate.m文件..

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

@WakkaoW也试试这个答案伙计.. http://stackoverflow.com/questions/4740732/iphone-force-mpmovieplayercontroller-to-play-video-in-landscape-mode :) –

0

对于iOS6的,你也应该确保您的info.plist中支持的界面方向键中添加了景观。