2012-09-13 4 views
1

iOS 5에서는 수동으로 방향을 바꿉니다. 모든 것이 정상입니다. 그러나 iOS 6에서는 키보드가 방향이 바뀌지 않습니다 .UAPppication statusBarOrientation이 작동하지 않습니다.iOS 6의 수동 변경 방향

답변

2

이 시도 :

- (UIInterfaceOrientationMask)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskLandscape; 
} 

을 대신 이것 :

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

UPDATE : 아이폰 OS 7 SDK에서

& 엑스 코드 5 :

- (NSUInteger)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskLandscape; 
} 
0

statusBarOrientation 메서드는 supportedInterfaceOrientations 콜백이 0을 반환하는 경우에만 작동합니다. 이전 코드 작업을 수행하려면 statusBarOrientation 메서드를 호출하기 전에 플래그를 true로 설정할 수 있습니다. statusBarOrientation이 호출되면이 플래그를 재설정 할 수 있습니다.

이 플래그가 참일 때 supportedInterfaceOrientations에서 0을 반환 할 수 있습니다.