세로보기가 포함 된 것과 가로보기가 포함 된 것을 제외하고 두 스토리 보드를 모두 만들었습니다.Xcode 4.5 및 iOS 6.x의 스토리 보드 오리엔테이션 지원?
내가 자동 크기 마스크를 사용하지 않기 때문에 완전히 가로 및 세로의 뷰 일부 변경의 레이아웃. 나는 수동으로 과거에 코드 뷰에 컨트롤을 이동 한하지만 난 쉬운 방법 후 내가 찾은 가장 가까운 솔루션 'benyboariu'출신이 시간 :
했다 - 여기
Storyboards orientation support for xCode 4.2? 코드입니다 iOS 5.x에서는 작동하지만 iOS 6.x에서는 작동하지 않는 것을 사용하고 있습니다.
- (void)updateLandscapeView
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (deviceOrientation == UIDeviceOrientationUnknown)
{
if ([[UIScreen mainScreen] bounds].size.height > [[UIScreen mainScreen] bounds].size.width)
{
deviceOrientation = UIDeviceOrientationPortrait;
self.appDelegate.isShowingLandscapeView = NO;
}
else
{
deviceOrientation = UIDeviceOrientationLandscapeLeft;
self.appDelegate.isShowingLandscapeView = YES;
}
}
if (UIDeviceOrientationIsLandscape(deviceOrientation) && !self.appDelegate.isShowingLandscapeView)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard-Landscape" bundle:[NSBundle mainBundle]];
UIViewController * landscape = [storyboard instantiateViewControllerWithIdentifier:@"RootViewController-Landscape"];
self.appDelegate.isShowingLandscapeView = YES;
[UIView transitionWithView:landscape.view duration:0 options:UIViewAnimationOptionTransitionCrossDissolve|UIViewAnimationCurveEaseIn animations:^{
self.view = landscape.view;
} completion:NULL];
}
else if (UIDeviceOrientationIsPortrait(deviceOrientation) && self.appDelegate.isShowingLandscapeView)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard-Portrait" bundle:[NSBundle mainBundle]];
UIViewController * portrait = [storyboard instantiateViewControllerWithIdentifier:@"RootViewController"];
self.appDelegate.isShowingLandscapeView = NO;
[UIView transitionWithView:portrait.view duration:0 options:UIViewAnimationOptionTransitionCrossDissolve|UIViewAnimationCurveEaseIn animations:^{
self.view = portrait.view;
} completion:NULL];
}
}
아이폰 OS 6.x의에서 디버깅 할 때 내가 갖는 오류는 다음과 같습니다 인해, 이유는 'UIViewControllerHierarchyInconsistency'캐치되지 않는 예외 응용 프로그램 종료
가 : 'A보기가 기껏과 연관 될 수 있습니다 한 번에 하나의보기 컨트롤러! UIView보기 : 0x108276b0; 프레임 = (0, 0, 568, 268); 자동 크기 조절 = RM + BM; 애니메이션 = {위치 = CABasicAnimation : 0x10815c60; bounds = CABasicAnimation : 0x1082a5e0; }; layer = CALayer : 0x10827710은 RootViewController : 0x10821f10과 연결됩니다. 이보기를 RootViewController : 0x961a150과 연결하기 전에이 연관을 지우십시오. '
나는 보통 이러한 종류의 오류를 해결하기 위해 NIB에서보기 컨트롤러를 연결 해제하지만 스토리 보드에서는이를 수행 할 수 없습니다.
누구나 아이디어가 있습니까?
안녕하세요, 당신은 1000으로 무엇을 2000으로 설정합니까? – Jules