2011-09-21 1 views
1

내 코드입니다 : IOS 힘 장치 회전 여기

if ([[UIApplication sharedApplication] statusBarOrientation] != UIInterfaceOrientationLandscapeLeft) { 
     [appDelegate makeTabBarHidden:TRUE]; 
     self.navigationController.navigationBarHidden = YES; 
     [UIView beginAnimations:@"newAlbum" context:NULL]; 
     [UIView setAnimationDelegate:self]; 
     [UIView setAnimationDidStopSelector:@selector(addResultGraph)]; 
     [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:YES]; 
     // Then rotate the view and re-align it: 
     CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(90.0 * M_PI/-180.0); 
     landscapeTransform = CGAffineTransformTranslate(landscapeTransform, +90.0, +90.0); 
     [self.navigationController.view setTransform:landscapeTransform]; 
     [UIView commitAnimations]; 
    } 

이와

가, 세로 모드에서, 새로운의 ViewController가 landscapeleft 모드로 표시되고, 모든 것이 괜찮습니다,하지만 내 문제가 : 나는 회전하는 경우 가로 모드에서 세로 방향으로 장치를 세로보기 모드로 표시하고 뷰 컨트롤러를 가로 모드로 유지하면 ....

어떻게 해결할 수 있습니까? 미리 감사드립니다. !

+0

잘 작동 회전하지 않습니다, shouldAutorotateToInterfaceOrientation 방법을 다시 구현하고

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

처럼 만 방향이 왼쪽 인 에이블 이런 식으로 뭔가를 할 수 있고 만약 내가 아이폰 회전 (절대) – ghiboz

답변

4

당신은 당신이 세로로 장치를 회전하면, 인터페이스가

+0

감사합니다, 나는 시도했지만 메서드가 호출되지 않습니다 제대로 작동하지 않는 것 ... – ghiboz

+0

괜찮아요, 해결, 내가 반환 false, '원인은 그 날 구현, 그렇지 않아 자동 회전 – ghiboz