2014-05-22 77 views
3

在我的項目中,我在視頻播放器中按完成按鈕,然後播放器關閉,但視圖保持橫向模式。但我希望在我的應用程序中以縱向瀏覽。只有視頻播放器才能移動兩側風景或人像。

我試試這個鏈接,但這不適合我。 enter link description here在ios6和ios7中將橫向旋轉到MPMoviePlayerViewController中的縱向

1Rotate Portrait to Landscape in pdfreader in ios6 and ios7

enter image description here


第一個是球員,當橫向模式和第二,當我在播放機中進行按鈕。請給我解決這個問題。

回答

0

在視圖控制器使用這種方法會自動移動portaint模式

#import <objc/message.h> 


-(void)viewDidAppear:(BOOL)animated{    

    if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { 
    objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationPortrait); 
    } 
} 
+0

其不工作.. – ilesh

+0

其被稱爲?你有斷點檢查 –

+0

是的這種方法是調用,但沒有設置肖像..仍然不能正常工作 – ilesh

相關問題