RootViewController로 제어되는 여러 UIViewController로 응용 프로그램을 구축하고 있습니다. 현재 plist에서 응용 프로그램의 기본값은 LandscapeRight입니다.iPhone : 가로보기 및 세로보기 만있는 응용 프로그램
- IntroView (가로 오른쪽 만)
- LandscapeView (가로 오른쪽 만)
- PortraitView (만 세로) :
내가 RootViewController에로드 할 수있는 다음과 같은 파일이 있다고 가정하자
또한 RootViewController의 shouldAutorotateToInterfaceOrientation에 다음을 추가했습니다.
,-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ([currentClass class] == PortraitView.class) {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
} else {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
} 내가 지금 this thread
if (self.interfaceOrientation == UIInterfaceOrientationPortrait) { //UIInterfaceOrientationLandscapeRight) {
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
self.view.bounds = CGRectMake(0.0, 0.0, 320, 480);
self.view.center = CGPointMake(240.0f, 160.0f);
}
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
이 제대로 PortraitView에로드 수익률하지만 내 문제에 다음과 같은 (비슷한을 추가 PortraitView에와 viewWillAppear에로드 할 때까지
그래서 모두가 잘 내 PortraitView 내에서 그 사이에 플립하고 싶습니다 2 subviews있다,하지만 내보기 UIViewAnimationTransitionFlipFromLeft 회전 실제로 있기 때문에 대신 맨 왼쪽에서 오른쪽 맨 위 플립합니다. 나는 내 인생에서 PortraitView에 초상화를 쓰는 방법을 알아낼 수 없다.
[[UIDevice currentDevice] orientation]을 선택하면; 그것은 풍경에 나에게 말한다. shouldAutorotateToInterfaceOrientation을 사용하여 Portrait로 설정하려고하면 내보기가 회전하여 더 이상 올바르지 않습니다.
희망적으로 말이 되네요! 하루 종일이 문제를보고있었습니다.
감사합니다.
RootViewController의 수퍼 클래스는 무엇입니까? 그냥 일반 UIViewController 이니? –
예, UIViewController입니다. 탐색 또는 탭 막대를 사용하지 않습니다. –