在我的應用程序中,我有一個UIWebview,我在其中顯示視頻鏈接列表。點擊其中一個鏈接,MPMoviePlayer自動啓動。但在全屏模式下,它在需要時不旋轉。MPMoviePlayer不旋轉
如何旋轉它,因爲我無法控制它在web視圖中。
在我的應用程序中,我有一個UIWebview,我在其中顯示視頻鏈接列表。點擊其中一個鏈接,MPMoviePlayer自動啓動。但在全屏模式下,它在需要時不旋轉。MPMoviePlayer不旋轉
如何旋轉它,因爲我無法控制它在web視圖中。
,如果你使用的是iOS 6中使用- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {}
因爲shouldautorotate沒有任何更多的支持iOS 6
後這個方法在AppDelegate.m
文件..
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
@WakkaoW也試試這個答案夥計.. http://stackoverflow.com/questions/4740732/iphone-force-mpmovieplayercontroller-to-play-video-in-landscape-mode :) –
對於iOS6的,你也應該確保您的info.plist中支持的界面方向鍵中添加了景觀。
景觀模式不工作你的意思是? –
是的。視頻僅限於肖像模式 – WakkaoW
您是否嘗試過下面的代碼? - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {YES;};}; } –