앱에서 세로 및 세로 모드 다운 모드에서 회전해야하는 앱이 있습니다. (모든 회전은 요약 패널에서 사용할 수 없습니다.)iOS 6에서는 자동으로 회전 할 수 없습니다.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown;
}
또는
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
을 아무리 내가 6
것 I를 IOS accure하는 회전을 얻을 수 없었다 뭘하려 지금까지 해봤 :
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
-(NSInteger)supportedInterfaceOrientations{
NSInteger mask = 0;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight])
mask |= UIInterfaceOrientationMaskLandscapeRight;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeLeft])
mask |= UIInterfaceOrientationMaskLandscapeLeft;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortrait])
mask |= UIInterfaceOrientationMaskPortrait;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortraitUpsideDown])
mask |= UIInterfaceOrientationMaskPortraitUpsideDown;
return mask;
}
내 AppDelegate에이 퍼팅 시도 :
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
하지만이 오류 받고 있어요 : 때문에, 이유 캐치되지 않는 예외 'UIApplicationInvalidInterfaceOrientation'응용 프로그램 종료를 '지원 방향은 응용 프로그램과 공통 방향이 없으며, shouldAutorotate가 반환 YES'
이 퍼팅 시도 내 대리자 :
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
NSUInteger orientations = UIInterfaceOrientationMaskAll;
if (self.window.rootViewController) {
UIViewController* presented = [[(UINavigationController *)self.window.rootViewController viewControllers] lastObject];
orientations = [presented supportedInterfaceOrientations];
}
return orientations;
}
나는 모든 그것에 대해 토론과 shouldAutorotateToInterfaceOrientation의 중단 된 읽기하지만 난 여전히 동작하지 않습니다. 나는 그것을 애플의 아이폰 OS 6 SDK 릴리스 노트에서
하나의 카테고리를 만들고 방향을 처리하십시오. 나를 위해 그것의 일 벌금. – Ganapathy
이렇게 할 수있는 방법을 알려주시겠습니까? – Segev
메서드를 제거하고 코드를 추가하고 알려주세요 - (BOOL) shouldAutorotate { return YES; } - (NSInteger) supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } – Spynet