아이폰 앱이 항상 세로로 작동합니다.아이폰이 가로 방향으로 바뀌면 풍경에 모달 뷰 컨트롤러가 나타납니다.
이 앱에는 탐색보기 컨트롤러가 있으며 rootViewcontroller
도 세로로 표시됩니다. 아이폰이 가로 방향으로 바뀌면 앱을 viewController
으로 보이고, 앱이 세로로 돌아 왔을 때이보기 컨트롤러를 닫습니다.
현재 나는이 달성하지만 내 의견은 완전히 이동 :
1 단계 :
2 단계 :
3 단계 : 나는 몇 가지를 시도
사물들,하지만 나는 그렇지 않아. 내가 올바른 방법을 선택 해요 알고 :
-(BOOL)shouldAutorotate
{
return YES;
}
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
}
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeLeft || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight) {
UIStoryboard *currentStoryboar = [self storyboard];
ASTBigProgressViewController *bigProgress = [currentStoryboar instantiateViewControllerWithIdentifier:@"ASTBigProgressViewController"];
[self presentViewController:bigProgress animated:YES completion:^{
}];
}
}
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
내가보기 컨트롤러가 켜져있을 때,이 같은 위치에 그것을 유지하는보기를 설정하지 않습니다 싶습니다. 나는 시도했다 :
-(BOOL)shouldAutorotate
{
return NO;
}
그러나 확실히 didRotateFromInterfaceOrientation
메서드는 호출되지 않았다.
아이디어가 있으십니까?
답장을 보내 주셔서 감사 드리며, 더 노력하고 있습니다. 가로 모드 모달보기가 바닥에서보기 대신 오른쪽에 나타나는 문제가 있습니다. – xarly
마지막으로, 저는이 방법을 사용했고 modalTransitionStyle = UIModalTransitionStyleCrossDissolve를 사용하여 오른쪽에서 애니메이션 문제를 수정했습니다. – xarly