이 주제는 (iPad modal view controller acting in portrait even though it's landscape) 이전에 발생했지만 명확한 답변을 찾지 못했습니다. 중복되는지 여부. 새로운 싱글 뷰 프로젝트에서스토리 보드에서 가로로 설정된 경우에도 UIView (iPad)의 기본 설정이 세로로 설정되는 이유
, 내가 엑스 코드에 가로로 기본보기를 설정 :
을 그리고 속성 관리자는이를 확인 (뿐만 아니라보기는 스토리 보드에 표시되는 방법) :
그리고의 ViewController 방향 속성은 가로로 설정됩니다
I '가있는 viewDidLoad'에서 뷰 프레임 검사시아직 세로 모드를보고
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect theRect = self.view.frame;
NSLog(@" frame %f %f %f %f", theRect.origin.x,
theRect.origin.y,
theRect.size.width,
theRect.size.height);
}
2012년 8월 26일 16 : 42 : 45.045 테스트 [2320 : F803] 셀 0.000000을 20.000000 768.000000 1004.000000
또한 shouldAutorotateToInterfaceOrientation에서 풍경을 강제로 :
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
이전에 여러 번이 문제가 발생하여 프레임을 명시 적으로 landscape로 설정해야했지만 모든 스토리 보드 설정이 효과가없는 이유를 알지 못했습니다.
여기에 기본적인 것이 누락 되었습니까?
아! - 요점은 내가 누락되었습니다. 위의 첫 번째 이미지 인 app plist에 쓰여진 'Supported Device Orientations'설정에 해당되는지, 적절한 'shouldAutorotateToInterfaceOrientation' 결과로 백업해야하는지 여부를 알고 계십니까? –
@skinnyTOD가 내 답변에 세부 사항을 추가했습니다. – Pfitz
감사합니다. 고맙습니다. –