2012-11-21 5 views
3

iPhone을 처음 사용하고 iPhone 응용 프로그램을 만드는 데 어려움이 있습니다 세로만 지원합니다.iPhone 응용 프로그램 - 스토리 보드 전용 세로 방향 지원

스토리 보딩과 iOS5 +를 사용하고 있습니다.

나는 여기서 좋은 모습을 보였고 다른 사람들을위한 제안은 나를 위해 일하지 않았다.

내가보기 컨트롤러에

-(BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation  
{ 
     return NO; 
} 

을 구현했는데,

<key>UISupportedInterfaceOrientations</key> 
<array> 
<string>UIInterfaceOrientationPortrait</string> 
</array> 

하지만 기쁨에 내 Info.plist 파일을 변경했습니다. 스토리 보드에서 속성 편집기에서 초상화를 선택했습니다.

더 이상의 아이디어가 있습니까?

많은 감사, 요르단

답변

2

xCode4에서 대상을 선택할 때 나타나는 방향 단추를 사용해 보았습니까?

enter image description here

+0

siiiiiiiiigh. 지원되는 장치 방향에서 인물 만이 선택되었습니다. 선택을 취소하고 다시 클릭했습니다. 이제 작동합니다! 오늘 xcode에서 많은 버그를 발견했습니다 .. 많은 감사! – Spordan

+0

도움이 된 것을 기쁘게 생각합니다. :) – alemangui

1

당신은 같은 방법에 대한 옵션 아래에 사용할 수 있습니다. plist 파일에서 변경할 필요가 없습니다.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
return ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)); 
} 

여기에서 나는 응용 프로그램이 세로 모드에서만 회전 할 수 있도록이를 사용하거나 조건 UIInterfaceOrientationPortraitUIInterfaceOrientationPortraitUpsideDown를 사용합니다.

응용 프로그램이 모든보기 측면에서 회전 할 수있게하려면 위의 메서드에서 YES을 반환합니다. return NO은보기를 회전시키지 않겠다는 뜻입니다.

관련 문제