Uiinterfaceorientationlandscapeleft 및 Uiinterfaceorientationlandscaperight가 반전 되었습니까?
-
05-07-2019 - |
문제
문서는 다음과 같이 말합니다.
UIInterfaceOrientationLandscapeLeft
장치는 조경 모드에 있으며 장치가 똑바로 세워지고 홈 버튼이 오른쪽에 있습니다.
UIInterfaceOrientationLandscapeRight
장치는 조경 모드에 있으며 장치가 똑바로 세워지고 홈 버튼이 왼쪽에 있습니다.
그러나 나는 그것들을 정확하게 반전시키고 있습니다. SDK에 실제로 그런 실수가있을 수 있습니까, 아니면 그냥 미쳤습니까?
암호:
+ (NSString *)NSStringFromUIInterfaceOrientation:(UIInterfaceOrientation)o
{
switch (o) {
case UIInterfaceOrientationPortrait: return @"UIInterfaceOrientationPortrait";
case UIInterfaceOrientationPortraitUpsideDown: return @"UIInterfaceOrientationPortraitUpsideDown";
case UIInterfaceOrientationLandscapeLeft: return @"UIInterfaceOrientationLandscapeLeft";
case UIInterfaceOrientationLandscapeRight: return @"UIInterfaceOrientationLandscapeRight";
}
return nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
NSLog(@"Should: %@", [[self class] NSStringFromUIInterfaceOrientation:toInterfaceOrientation]);
return YES;
}
기본 탐색 기반 앱 템플릿의 rootViewController.m에 위 코드를 붙여 넣습니다.
후속 조치 : 보고 된 버그 7216046.
해결책
문서를 올바르게 읽고 있다고 확신하십니까? 홈 버튼 위치와 방향 값은 반대 - 그건, UIInterfaceOrientationLandscapeLeft
홈 버튼을 의미합니다 오른쪽 측면, 그리고 UIInterfaceOrientationLandscapeRight
홈 버튼을 의미합니다 왼쪽 옆. 제대로 확인하기 위해 장치를 회전시키고 있는지 확인하십시오.
편집하다: 원래 질문에 제시된 문제를 확인했습니다. 내가 뭔가를 놓치지 않는 한 버그처럼 보입니다.
제휴하지 않습니다 StackOverflow