2014-09-22 2 views
0

응용 프로그램의 모든 페이지는 potrait 모드에 있어야합니다. 하지만 특정 페이지에서, 당신은 webview에서 튜브 비디오를로드하고 있습니다. 비디오를 클릭하면 mpmovie 플레이어 컨트롤러에 비디오가 표시되고 가로 모드로이 비디오를 표시합니다. 내가 어떻게 할 수 있니? 어떤 도움이라도 대단히 감사 할 것입니다.potrait 모드에서 내 viewcontroller 모든 응용 프로그램의 가로보기 모드에서 특정 viewcontroller 싶습니다

+0

같은 것을 사용할 수 있습니다 확신 해요, 당신은 여기에 대한 답변 http://stackoverflow.com/questions/20372223/maintain을 찾을 수 있습니다 -one-view-controller-in-portrait 및 other-in-landscape-mode-ios http://stackoverflow.com/questions/16392021/first-uiview-in-portrait-orientation-and-second-in -landscape? rq = 1 – Oleshko

+0

유사한 질문에 대한 내 대답을 확인하십시오 - http://stackoverflow.com/questions/23491426/ios-7-how-to-allow-only-portrait-orientation-for-vc/23491583#23491583 – Bharat

답변

0

당신은 당신이 당신의보기를 선택할 수있는 스토리 보드를 사용하는 경우 당신은 내가 그 일을 생각 가로 모드에있을 필요가 뷰 컨트롤러의 viewDidLoad에서이 라인 ...

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

그게 나를 위해 일하고 – Rafay

+0

내 편집 된 답변 확인 ... –

0

을 넣어야 할 속성 관리자에서 "추론"대신 원하는 방향을 선택할 수 있습니다. 당신은 스토리 보드에없는 경우

난 당신이 어쩌면이

webview.orientation = UIOrientationPortrait (haven't tried it but it must be pretty similar) 
+0

웹뷰의 오리엔테이션 속성을 찾지 못했습니다 .. – Rafay

+0

도움이 되나요? http://stackoverflow.com/questions/2325795/webview-resizes-automatically-to-portrait-and-landscape-view-in-iphone 한 번 회전 된 웹보기의 크기를 조정하는 방법에 대해 알아야합니다. shouldAutorotateMethod를 사용하여 회전합니다. 하지만 테스트가 필요하고 지금 당장 시간이 없어. 나는 너에게 보여줄 길을 찾고있다. –