2013-01-21 1 views
0

나는 이것이 아주 일반적인 문제점다는 것을 나가 그러나 나의 해결책을 찾아 내지 않은 해결책을 깨닫는다.iPad 자동 회전 문제 iOS 6으로 건축하십시오

프리젠 테이션을 시작할 때 Game Center에서 발생하는 문제를 해결하려면 모든 방향에 대해 지원되는 인터페이스 방향을 추가해야합니다. 이제 iPhone/iPod에서의 충돌이 특정 장치에서 해결되었습니다.

이제 내가 가진 문제는 iPad 1에만 해당됩니다. 게임을 시작할 때 세로 모드로 iPad를 잡고 있으면 게임을 세로 방향으로 유지할 수 있습니다 (회전을 시도하면 STARTUP에서만 문제가 발생합니다). 지원되는 인터페이스 방향에서 세로 방향을 제거하지 않는 한. 불행히도이 작업을 수행하면 앱이 다른 기기에서 중단됩니다.

본인의 인터페이스 방향은 가로로 왼쪽입니다.

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
{ 
    return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

- (NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskLandscapeRight|UIInterfaceOrientationMaskLandscapeLeft; 
} 


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 
{ 
    return UIInterfaceOrientationLandscapeRight; 
} 

- (BOOL)shouldAutorotate{ 
    return YES; 
} 
+0

이 늘 작품은 아이팟/아이폰에 충돌 할

내가 현재 가지고있는 코드입니다. – Asheh

답변

1

은 AppDelegate에이 시도 : 내가 이런 짓을하는 경우

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 
    if(orientation == UIDeviceOrientationPortrait || orientation == UIDeviceOrientationPortraitUpsideDown) 
     [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; 
} 
+0

이것은 효과가 뛰어났습니다! – Asheh